@flarehr/cars-calculator 2.3.49 → 2.3.57
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/lib/cars-calculator/cars-calculator.esm.js +1 -1
- package/dist/lib/cars-calculator/cars-calculator.js +1 -1
- package/dist/lib/cars-calculator/{p-b7e7dc0f.system.entry.js → p-08f08988.system.entry.js} +1 -1
- package/dist/lib/cars-calculator/{p-0b08c63c.system.js → p-19b00569.system.js} +1 -1
- package/dist/lib/cars-calculator/{p-92efd97a.system.entry.js → p-2f318de8.system.entry.js} +1 -1
- package/dist/lib/cars-calculator/{p-cc24e248.js → p-34be9e94.js} +1 -1
- package/dist/lib/cars-calculator/{p-9e42ba48.system.entry.js → p-3986811b.system.entry.js} +1 -1
- package/dist/lib/cars-calculator/{p-69382409.entry.js → p-40adf333.entry.js} +1 -1
- package/dist/lib/cars-calculator/p-45d6fbc2.system.js +1 -0
- package/dist/lib/cars-calculator/{p-82b4b9ca.entry.js → p-5feb27ac.entry.js} +1 -1
- package/dist/lib/cars-calculator/{p-5e27b626.js → p-628050dd.js} +1 -1
- package/dist/lib/cars-calculator/{p-f91aa986.system.js → p-6339bd49.system.js} +1 -1
- package/dist/lib/cars-calculator/{p-a0ed3a75.system.js → p-63ad215f.system.js} +1 -1
- package/dist/lib/cars-calculator/{p-03836e14.entry.js → p-6a379ac2.entry.js} +1 -1
- package/dist/lib/cars-calculator/p-7062880e.js +1 -0
- package/dist/lib/cars-calculator/{p-20a242dc.entry.js → p-7141bc11.entry.js} +1 -1
- package/dist/lib/cars-calculator/{p-ac38cb9d.system.entry.js → p-7234d34c.system.entry.js} +1 -1
- package/dist/lib/cars-calculator/{p-9cc8b374.system.entry.js → p-7fed1bfc.system.entry.js} +1 -1
- package/dist/lib/cars-calculator/{p-192dd4a3.system.js → p-8d4bb973.system.js} +1 -1
- package/dist/lib/cars-calculator/{p-25e24da6.system.entry.js → p-94ba6def.system.entry.js} +1 -1
- package/dist/lib/cars-calculator/{p-5efd0fbd.entry.js → p-a54b8d09.entry.js} +1 -1
- package/dist/lib/cars-calculator/{p-50451ff0.entry.js → p-aa6eeef5.entry.js} +1 -1
- package/dist/lib/cars-calculator/{p-98bd1117.system.entry.js → p-aa7dc5dc.system.entry.js} +1 -1
- package/dist/lib/cars-calculator/{p-819cfa63.js → p-ab3a7737.js} +1 -1
- package/dist/lib/cars-calculator/{p-821b5928.entry.js → p-af1b58b9.entry.js} +1 -1
- package/dist/lib/cars-calculator/{p-78c4dce3.system.js → p-b41f72c8.system.js} +1 -1
- package/dist/lib/cars-calculator/{p-598f4a0b.system.js → p-b51215ae.system.js} +1 -1
- package/dist/lib/cars-calculator/{p-69960bb6.system.js → p-bdb3fb61.system.js} +1 -1
- package/dist/lib/cars-calculator/{p-5c2cc99d.js → p-bf086b51.js} +1 -1
- package/dist/lib/cars-calculator/p-c39a8fe9.entry.js +1 -0
- package/dist/lib/cars-calculator/p-c3b6466e.js +1 -0
- package/dist/lib/cars-calculator/{p-3126f655.system.entry.js → p-c3d37683.system.entry.js} +1 -1
- package/dist/lib/cars-calculator/p-c49546ea.entry.js +1 -0
- package/dist/lib/cars-calculator/{p-88c232fe.system.entry.js → p-c77c24a6.system.entry.js} +1 -1
- package/dist/lib/cars-calculator/{p-1bc2b206.system.js → p-c9562e73.system.js} +1 -1
- package/dist/lib/cars-calculator/p-cbc447c7.system.entry.js +1 -0
- package/dist/lib/cars-calculator/{p-2e1b766b.system.entry.js → p-cd0073f4.system.entry.js} +1 -1
- package/dist/lib/cars-calculator/{p-c35d387e.js → p-d14b00d9.js} +1 -1
- package/dist/lib/cars-calculator/{p-c4cda1ba.entry.js → p-e385dbe0.entry.js} +1 -1
- package/dist/lib/cars-calculator/{p-066d8e7b.js → p-f3effa5d.js} +1 -1
- package/dist/lib/cars-calculator/{p-4b3e246f.js → p-fa160c9f.js} +1 -1
- package/dist/lib/cars-calculator/{p-8ec3baa9.system.js → p-fa7a5280.system.js} +1 -1
- package/dist/lib/cars-calculator/{p-e45ce69c.entry.js → p-ffa283e3.entry.js} +1 -1
- package/dist/lib/cjs/ap-ben-asset_15.cjs.entry.js +1 -1
- package/dist/lib/cjs/ap-ben-benefit-card.cjs.entry.js +3 -3
- package/dist/lib/cjs/ap-ben-benefit-list-item.cjs.entry.js +3 -3
- package/dist/lib/cjs/ap-ben-benefit-url_10.cjs.entry.js +6 -6
- package/dist/lib/cjs/ap-ben-benefits-list_3.cjs.entry.js +3 -3
- package/dist/lib/cjs/ap-ben-benefits-page.cjs.entry.js +4 -4
- package/dist/lib/cjs/ap-ben-confirm-dialog_4.cjs.entry.js +3 -3
- package/dist/lib/cjs/ap-ben-edit-benefit-page_5.cjs.entry.js +4 -4
- package/dist/lib/cjs/ap-ben-loading-page_2.cjs.entry.js +4 -4
- package/dist/lib/cjs/ap-ben-oidc-callback-page.cjs.entry.js +2 -2
- package/dist/lib/cjs/api-client-00edc9b6.js +107 -0
- package/dist/lib/cjs/{app-globals-086f9d49.js → app-globals-dec360ac.js} +1 -1
- package/dist/lib/cjs/{authentication.service-11c30071.js → authentication.service-12f9ead3.js} +1 -1
- package/dist/lib/cjs/benefits-app-host.cjs.entry.js +2 -2
- package/dist/lib/cjs/{benefits-app.query-97410065.js → benefits-app.query-98898e4c.js} +2 -2
- package/dist/lib/cjs/{benefits.api-053c4334.js → benefits.api-a4bd9804.js} +1 -1
- package/dist/lib/cjs/cars-calculator.cjs.js +2 -2
- package/dist/lib/cjs/{datorama-akita-792b4d1d.js → datorama-akita-bb801820.js} +15 -5
- package/dist/lib/cjs/{event-tracking.service-6ae64142.js → event-tracking.service-fcc820f1.js} +1 -1
- package/dist/lib/cjs/loader.cjs.js +2 -2
- package/dist/lib/cjs/{manage-benefits.service-04883c9b.js → manage-benefits.service-f45b4602.js} +3 -3
- package/dist/lib/cjs/{role-management.service-120cb99a.js → role-management.service-2109723c.js} +2 -2
- package/dist/lib/esm/ap-ben-asset_15.entry.js +1 -1
- package/dist/lib/esm/ap-ben-benefit-card.entry.js +3 -3
- package/dist/lib/esm/ap-ben-benefit-list-item.entry.js +3 -3
- package/dist/lib/esm/ap-ben-benefit-url_10.entry.js +6 -6
- package/dist/lib/esm/ap-ben-benefits-list_3.entry.js +3 -3
- package/dist/lib/esm/ap-ben-benefits-page.entry.js +4 -4
- package/dist/lib/esm/ap-ben-confirm-dialog_4.entry.js +3 -3
- package/dist/lib/esm/ap-ben-edit-benefit-page_5.entry.js +4 -4
- package/dist/lib/esm/ap-ben-loading-page_2.entry.js +4 -4
- package/dist/lib/esm/ap-ben-oidc-callback-page.entry.js +2 -2
- package/dist/lib/esm/api-client-a68152b8.js +99 -0
- package/dist/lib/esm/{app-globals-aa396171.js → app-globals-2a868a4d.js} +1 -1
- package/dist/lib/esm/{authentication.service-05da74e1.js → authentication.service-905f97c2.js} +1 -1
- package/dist/lib/esm/benefits-app-host.entry.js +2 -2
- package/dist/lib/esm/{benefits-app.query-9179a170.js → benefits-app.query-bfee691f.js} +2 -2
- package/dist/lib/esm/{benefits.api-5ecab17a.js → benefits.api-806ca0bc.js} +1 -1
- package/dist/lib/esm/cars-calculator.js +2 -2
- package/dist/lib/esm/{datorama-akita-e42d9911.js → datorama-akita-d2413fd0.js} +15 -5
- package/dist/lib/esm/{event-tracking.service-bc65ac3b.js → event-tracking.service-8d44e7ac.js} +1 -1
- package/dist/lib/esm/loader.js +2 -2
- package/dist/lib/esm/{manage-benefits.service-08338cf7.js → manage-benefits.service-aca7df4c.js} +3 -3
- package/dist/lib/esm/{role-management.service-0e339b49.js → role-management.service-a7592363.js} +2 -2
- package/dist/lib/esm-es5/ap-ben-asset_15.entry.js +1 -1
- package/dist/lib/esm-es5/ap-ben-benefit-card.entry.js +1 -1
- package/dist/lib/esm-es5/ap-ben-benefit-list-item.entry.js +1 -1
- package/dist/lib/esm-es5/ap-ben-benefit-url_10.entry.js +1 -1
- package/dist/lib/esm-es5/ap-ben-benefits-list_3.entry.js +1 -1
- package/dist/lib/esm-es5/ap-ben-benefits-page.entry.js +1 -1
- package/dist/lib/esm-es5/ap-ben-confirm-dialog_4.entry.js +1 -1
- package/dist/lib/esm-es5/ap-ben-edit-benefit-page_5.entry.js +1 -1
- package/dist/lib/esm-es5/ap-ben-loading-page_2.entry.js +1 -1
- package/dist/lib/esm-es5/ap-ben-oidc-callback-page.entry.js +1 -1
- package/dist/lib/esm-es5/api-client-a68152b8.js +1 -0
- package/dist/lib/esm-es5/{app-globals-aa396171.js → app-globals-2a868a4d.js} +1 -1
- package/dist/lib/esm-es5/{authentication.service-05da74e1.js → authentication.service-905f97c2.js} +1 -1
- package/dist/lib/esm-es5/benefits-app-host.entry.js +1 -1
- package/dist/lib/esm-es5/{benefits-app.query-9179a170.js → benefits-app.query-bfee691f.js} +1 -1
- package/dist/lib/esm-es5/{benefits.api-5ecab17a.js → benefits.api-806ca0bc.js} +1 -1
- package/dist/lib/esm-es5/cars-calculator.js +1 -1
- package/dist/lib/esm-es5/{datorama-akita-e42d9911.js → datorama-akita-d2413fd0.js} +1 -1
- package/dist/lib/esm-es5/{event-tracking.service-bc65ac3b.js → event-tracking.service-8d44e7ac.js} +1 -1
- package/dist/lib/esm-es5/loader.js +1 -1
- package/dist/lib/esm-es5/{manage-benefits.service-08338cf7.js → manage-benefits.service-aca7df4c.js} +1 -1
- package/dist/lib/esm-es5/{role-management.service-0e339b49.js → role-management.service-a7592363.js} +1 -1
- package/package.json +7 -3
- package/dist/lib/cars-calculator/p-1bdb5093.entry.js +0 -1
- package/dist/lib/cars-calculator/p-307f91bf.system.entry.js +0 -1
- package/dist/lib/cars-calculator/p-56fb974f.entry.js +0 -1
- package/dist/lib/cars-calculator/p-69cf2679.system.js +0 -1
- package/dist/lib/cars-calculator/p-dc58dd5c.js +0 -1
- package/dist/lib/cars-calculator/p-df0a267a.js +0 -1
- package/dist/lib/cjs/api-client-a3c12426.js +0 -107
- package/dist/lib/esm/api-client-8974d2bd.js +0 -99
- package/dist/lib/esm-es5/api-client-8974d2bd.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as s,h as i,H as t}from"./p-91e1cdd0.js";import{b as a,n as e,c as o,s as n}from"./p-2c9dd7c4.js";import{b as r}from"./p-bf086b51.js";import{b as p}from"./p-d14b00d9.js";import"./p-7062880e.js";import"./p-7ad92407.js";import"./p-f3effa5d.js";import"./p-ea120e31.js";import"./p-054d1471.js";import"./p-f63d9d89.js";const c=new class{async getViewPageState(){return r.getBenefitsAsync()}async getShopifyUrl(){return a((await r.getShopifyUrl()).redirectUrl)}},d=class{constructor(i){s(this,i),this.shopifyUrl=e,this.urlRefreshHandle=e}async componentWillLoad(){this.state=await c.getViewPageState()}async componentDidLoad(){this.shopifyUrl=await c.getShopifyUrl(),this.setupShopifyUrlRefresh(),await p.trackPageViewedAsync({pageId:"viewBenefits"})}disconnectedCallback(){o(this.urlRefreshHandle)&&window.clearInterval(this.urlRefreshHandle.value)}render(){return i(t,{class:"w-100 mb-4"},i("ap-ben-ui-container",{class:"mt-4 d-none"},i("div",{class:"row"},i("div",{class:"col-12"},i("ap-ben-hero-banner",{shopifyUrl:this.shopifyUrl}))),i("div",{class:"row"},i("div",{class:"col-12"},i("ap-ben-promoted-benefits",{benefits:this.state.promotedBenefits}))),i("div",{class:"row"},i("div",{class:"col-12"},i("ap-ben-benefits-list",{benefits:this.state.availableBenefits})))))}setupShopifyUrlRefresh(){this.urlRefreshHandle=n(window.setInterval((async()=>{this.shopifyUrl=await c.getShopifyUrl()}),12e4))}};export{d as ap_ben_benefits_page}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(t,e,i,n){function r(t){return t instanceof i?t:new i((function(e){e(t)}))}return new(i||(i=Promise))((function(i,a){function s(t){try{l(n.next(t))}catch(t){a(t)}}function o(t){try{l(n["throw"](t))}catch(t){a(t)}}function l(t){t.done?i(t.value):r(t.value).then(s,o)}l((n=n.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var i={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,r,a,s;return s={next:o(0),throw:o(1),return:o(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(t){return function(e){return l([t,e])}}function l(s){if(n)throw new TypeError("Generator is already executing.");while(i)try{if(n=1,r&&(a=s[0]&2?r["return"]:s[0]?r["throw"]||((a=r["return"])&&a.call(r),0):r.next)&&!(a=a.call(r,s[1])).done)return a;if(r=0,a)s=[s[0]&2,a.value];switch(s[0]){case 0:case 1:a=s;break;case 4:i.label++;return{value:s[1],done:false};case 5:i.label++;r=s[1];s=[0];continue;case 7:s=i.ops.pop();i.trys.pop();continue;default:if(!(a=i.trys,a=a.length>0&&a[a.length-1])&&(s[0]===6||s[0]===2)){i=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){i.label=s[1];break}if(s[0]===6&&i.label<a[1]){i.label=a[1];a=s;break}if(a&&i.label<a[2]){i.label=a[2];i.ops.push(s);break}if(a[2])i.ops.pop();i.trys.pop();continue}s=e.call(t,i)}catch(t){s=[6,t];r=0}finally{n=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};System.register(["./p-6c8594d0.system.js","./p-9a8c9350.system.js","./p-
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(t,e,i,n){function r(t){return t instanceof i?t:new i((function(e){e(t)}))}return new(i||(i=Promise))((function(i,a){function s(t){try{l(n.next(t))}catch(t){a(t)}}function o(t){try{l(n["throw"](t))}catch(t){a(t)}}function l(t){t.done?i(t.value):r(t.value).then(s,o)}l((n=n.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var i={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,r,a,s;return s={next:o(0),throw:o(1),return:o(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(t){return function(e){return l([t,e])}}function l(s){if(n)throw new TypeError("Generator is already executing.");while(i)try{if(n=1,r&&(a=s[0]&2?r["return"]:s[0]?r["throw"]||((a=r["return"])&&a.call(r),0):r.next)&&!(a=a.call(r,s[1])).done)return a;if(r=0,a)s=[s[0]&2,a.value];switch(s[0]){case 0:case 1:a=s;break;case 4:i.label++;return{value:s[1],done:false};case 5:i.label++;r=s[1];s=[0];continue;case 7:s=i.ops.pop();i.trys.pop();continue;default:if(!(a=i.trys,a=a.length>0&&a[a.length-1])&&(s[0]===6||s[0]===2)){i=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){i.label=s[1];break}if(s[0]===6&&i.label<a[1]){i.label=a[1];a=s;break}if(a&&i.label<a[2]){i.label=a[2];i.ops.push(s);break}if(a[2])i.ops.pop();i.trys.pop();continue}s=e.call(t,i)}catch(t){s=[6,t];r=0}finally{n=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};System.register(["./p-6c8594d0.system.js","./p-9a8c9350.system.js","./p-fa7a5280.system.js","./p-6efcc4fd.system.js","./p-0045ce79.system.js","./p-01cc3fd8.system.js","./p-45d6fbc2.system.js","./p-19b00569.system.js","./p-0eebae53.system.js","./p-d19c8a5d.system.js"],(function(t){"use strict";var e,i,n,r,a,s,o,l;return{setters:[function(t){e=t.r;i=t.c;n=t.h;r=t.H},function(t){a=t.i},function(t){s=t.a;o=t.b},function(t){l=t.a},function(){},function(){},function(){},function(){},function(){},function(){}],execute:function(){var c=t("ap_ben_confirm_dialog",function(){function t(t){e(this,t);this.accepted=i(this,"accepted",7);this.declined=i(this,"declined",7);this.cancelled=i(this,"cancelled",7);this.dialogStyle="success";this.allowedDialogStyles=["success","danger","warning","info"]}t.prototype.componentWillLoad=function(){this.validateDialogStyle()};t.prototype.componentDidUpdate=function(){this.validateDialogStyle()};t.prototype.render=function(){var t=this;return n("div",{class:"uiid-delete-benefit-popup"},n("div",{class:"my-3"},n("slot",null)),n("div",{class:"text-right"},n("button",{class:"uiid-confirm-delete-benefit-item btn btn-"+this.dialogStyle+" mr-3",onClick:function(e){var i;(i=t.accepted)===null||i===void 0?void 0:i.emit()}},this.acceptText||"Accept"),n("button",{class:"btn btn-light",onClick:function(e){var i;(i=t.declined)===null||i===void 0?void 0:i.emit()}},this.declineText||"Decline")))};t.prototype.validateDialogStyle=function(){var t=this;if(!this.allowedDialogStyles.some((function(e){return e===t.dialogStyle}))){this.dialogStyle="success"}};return t}());var d=t("ap_ben_role_editors_section",function(){function t(t){e(this,t);this.storeSubscription=new l;this.isEmailValid=false;this.displayInvalidEmailError=false;this.emailNotExist=false;this.isLoading=false;this.emailRegex=/(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])/;this.editorItem=function(t){var e=t.basicProfile,i=t.benefitsProfile;var r=function(t){switch(t){case"accountAdmin":return"Admin";case"accountEditor":return"Editor";case"user":return"User";default:return"Unknown"}};return n("tr",null,n("td",null,e.firstName),n("td",null,e.email),n("td",null,r(i.role)),n("td",{class:"text-center"},n("a",{href:"#",onClick:function(e){e.preventDefault();s.showRemoveEditorDialog(t)}},"Remove")))}}t.prototype.componentWillLoad=function(){var t=this;this.storeSubscription.add(o.editorProfiles$.subscribe((function(e){return t.editorProfiles=e})));this.storeSubscription.add(o.editorLoading$.subscribe((function(e){return t.isLoading=e})))};t.prototype.disconnectedCallback=function(){this.storeSubscription.unsubscribe()};t.prototype.render=function(){var t=this;return n(r,null,n("h5",null,"Editors"),n("hr",null),n("form",{class:"needs-validation",novalidate:true,ref:function(e){return t.form=e}},n("div",{class:"d-flex align-items-start flex-column"},n("h6",null,"Add new editor"),n("div",{class:"d-flex align-items-center "+(this.displayInvalidEmailError?"was-validated":"")},n("input",{type:"text",name:"editorEmail",maxLength:50,required:true,class:"form-control w-auto "+(this.emailNotExist?"is-invalid":""),onFocus:function(e){t.emailNotExist=false;t.displayInvalidEmailError=false},pattern:this.emailRegex.source}),n("fl-button",{onClick:function(e){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.addEditorHandler(e)]}))}))},class:"ml-3"},n("div",{class:"d-flex"},n("ap-ben-icon",{class:"fa mr-2",iconPrefix:"fad",iconId:"user-plus"}),n("div",null,"Add"))),n("fl-loading-indicator",{class:"ml-3 "+(this.isLoading?"":"d-none")}),n("div",{class:"invalid-feedback ml-3 flex-grow-2"},this.emailNotExist?"Email not exists, please check again.":"Please input a valid Email.")))),n("div",{class:"border rounded mt-4 px-0"},n("table",{class:"table m-0"},n("thead",{class:"thead-light"},n("tr",null,n("th",{scope:"col"},"NAME"),n("th",{scope:"col"},"EMAIL"),n("th",{scope:"col"},"ROLE"),n("th",{scope:"col"}))),n("tbody",null,this.editorProfiles.map(this.editorItem)))))};t.prototype.addEditorHandler=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i;return __generator(this,(function(n){switch(n.label){case 0:t.preventDefault();this.isEmailValid=this.form.checkValidity();this.displayInvalidEmailError=!this.isEmailValid;if(!this.isEmailValid){return[2]}e=this.form.elements.namedItem("editorEmail");return[4,s.addEditorByEmail(e.value)];case 1:i=n.sent();if(a(i)){this.emailNotExist=true}else{e.value=""}return[2]}}))}))};return t}());var u=t("ap_ben_role_owner_section",function(){function t(t){e(this,t)}t.prototype.render=function(){var t=this.owner.basicProfile;return n(r,null,n("h5",null,"Owner"),n("hr",null),n("div",{class:"d-flex border rounded px-3"},n("div",{class:"d-flex flex-wrap align-content-center"},n("ap-ben-icon",{class:"text-black-50 fa-4x",iconPrefix:"fad",iconId:"user-circle"})),n("div",{class:"d-flex align-items-start flex-column m-3"},n("h5",null,n("b",null,t.firstName+" "+t.lastName)),n("div",null,t.email))))};return t}());var f=".slide-fwd-center{-webkit-animation:slide-fwd-center 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;animation:slide-fwd-center 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;}@-webkit-keyframes slide-fwd-center{0%{-webkit-transform:translateY(-10px);transform:translateY(-10px);opacity:0.5}100%{-webkit-transform:translateY(0px);transform:translateY(0px);opacity:1}}@keyframes slide-fwd-center{0%{-webkit-transform:translateY(-10px);transform:translateY(-10px);opacity:0.5}100%{-webkit-transform:translateY(0px);transform:translateY(0px);opacity:1}}";var p=t("ap_ben_ui_container",function(){function t(t){e(this,t);this.isAppInitialised=false}t.prototype.componentDidLoad=function(){this.isAppInitialised=true};t.prototype.render=function(){return n(r,{class:{"slide-fwd-center":true,"d-none":!this.isAppInitialised,"d-block":this.isAppInitialised}},n("slot",null))};return t}());p.style=f}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register(["./p-6c8594d0.system.js","./p-
|
|
1
|
+
System.register(["./p-6c8594d0.system.js","./p-bdb3fb61.system.js","./p-19b00569.system.js","./p-6efcc4fd.system.js","./p-0eebae53.system.js","./p-d19c8a5d.system.js"],(function(e,t){"use strict";var i,s,a;return{setters:[function(e){i=e.p;s=e.b},function(e){a=e.g},function(){},function(){},function(){},function(){}],execute:function(){var e=function(){var e=t.meta.url;var s={};if(e!==""){s.resourcesUrl=new URL(".",e).href}return i(s)};e().then((function(e){a();return s([["p-7234d34c.system",[[0,"benefits-app-host",{sessionState:[32],jwt:[32],appConfiguration:[32]}]]],["p-7fed1bfc.system",[[0,"ap-ben-benefits-page",{state:[32],shopifyUrl:[32]}]]],["p-3c565a1c.system",[[1,"fl-style-guide",{themeCssUrl:[1,"theme-css-url"]}]]],["p-37508ecf.system",[[0,"ap-ben-notifications-section"]]],["p-cbc447c7.system",[[0,"ap-ben-oidc-callback-page",{history:[16],callbackMode:[1,"callback-mode"]}]]],["p-8c74820a.system",[[0,"context-consumer",{context:[16],renderer:[16],subscribe:[16],unsubscribe:[32]}]]],["p-6bdc1b68.system",[[0,"stencil-async-content",{documentLocation:[1,"document-location"],content:[32]}]]],["p-731ef321.system",[[0,"stencil-route-title",{titleSuffix:[1,"title-suffix"],pageTitle:[1,"page-title"]}]]],["p-9414a992.system",[[0,"stencil-router-prompt",{when:[4],message:[1],history:[16],unblock:[32]}]]],["p-f9f40f6c.system",[[0,"stencil-router-redirect",{history:[16],root:[1],url:[1]}]]],["p-47c6094c.system",[[0,"fl-dropdown-async",{placeholder:[1],searchFunction:[16],value:[16],required:[4],requiredValidationMessage:[1,"required-validation-message"],disabled:[4],minSearchStringLength:[2,"min-search-string-length"],searchState:[32],inputValue:[32],isDropdownVisible:[32],filteredOptions:[32],highlightedOptionIndex:[32],selectedOption:[32]},[[2,"focus","handleFocus"],[2,"blur","handleBlur"],[2,"keydown","handleKeyDown"]]]]],["p-fe1f5ace.system",[[0,"ap-ben-icon",{iconPrefix:[1,"icon-prefix"],iconId:[1,"icon-id"],spin:[4]}]]],["p-94ba6def.system",[[0,"ap-ben-benefit-card",{benefitWithId:[16]}]]],["p-aa7dc5dc.system",[[0,"ap-ben-benefit-list-item",{benefitWithId:[16]}]]],["p-3986811b.system",[[0,"ap-ben-benefits-list",{benefits:[16]}],[0,"ap-ben-promoted-benefits",{benefits:[16]}],[0,"ap-ben-hero-banner",{shopifyUrl:[16]}]]],["p-c3d37683.system",[[1,"cars-calculator-app",{apiBaseUrl:[1,"api-base-url"],profileId:[1,"profile-id"],areStylesLoaded:[32],isModelSelected:[32],isVariantSelected:[32],isQuoteCalculated:[32]}],[0,"ap-ben-quote-result-section",{quote:[32],showRequestQuoteModal:[32],showBreakdownModal:[32],showCompletePage:[32]}],[0,"ap-ben-model-variants-section",{variantsList:[32],selectedVariant:[32]}],[0,"ap-ben-choose-vehicle-section",{makeList:[32],modelList:[32],yearList:[32],bodyTypeList:[32],vehicleInfo:[32]}],[0,"ap-ben-personal-info-section",{userInfo:[32]}],[0,"ap-ben-submit-quote-section",{userDetails:[32],formState:[32]}],[0,"ap-ben-complete-section"],[0,"ap-ben-asset",{image:[1]}],[0,"ap-ben-cost-breakdown-section",{quote:[16]}],[4,"ap-ben-tooltip",{target:[16],placement:[1],isVisible:[32]}],[0,"fl-dropdown",{placeholder:[1],options:[16],value:[16],required:[4],requiredValidationMessage:[1,"required-validation-message"],disabled:[4],inputValue:[32],isDropdownVisible:[32],filteredOptions:[32],highlightedOptionIndex:[32],selectedOption:[32]},[[2,"focus","handleFocus"],[2,"blur","handleBlur"],[2,"keydown","handleKeyDown"]]],[4,"ap-ben-modal-section",{show:[8],modalTitle:[8,"modal-title"],showFooter:[4,"show-footer"],showHeader:[4,"show-header"]}],[4,"fl-promise-button",{isBlockElement:[4,"is-block-element"],isRounded:[4,"is-rounded"],disabled:[4],variant:[1],promiseFn:[16],state:[32]}],[0,"fl-loading-indicator",{theme:[1]}],[4,"fl-button",{isBlockElement:[4,"is-block-element"],disabled:[4],variant:[1],outline:[4]}]]],["p-c77c24a6.system",[[0,"ap-ben-role-editors-section",{editorProfiles:[32],isEmailValid:[32],displayInvalidEmailError:[32],emailNotExist:[32],isLoading:[32]}],[0,"ap-ben-role-owner-section",{owner:[16]}],[4,"ap-ben-confirm-dialog",{titleText:[1,"title-text"],acceptText:[1,"accept-text"],declineText:[1,"decline-text"],dialogStyle:[1,"dialog-style"]}],[4,"ap-ben-ui-container",{isAppInitialised:[32]}]]],["p-2f318de8.system",[[0,"ap-ben-role-management-page",{showRemoveConfirmDialog:[32],user:[32]}],[0,"ap-ben-edit-benefit-form",{isValidationDisplayed:[4,"is-validation-displayed"],disabled:[4],draftBenefit:[32]}],[0,"ap-ben-managed-benefit-item",{benefit:[16]}],[0,"ap-ben-empty-benefits"],[0,"ap-ben-upload-file",{uploadedFile:[32],uploadFileState:[32],isUploadError:[32]}],[0,"ap-ben-benefit-url",{benefitUrl:[32],uiState:[32],inputState:[32]}],[0,"ap-ben-upload-benefit-icon",{customIcon:[32],uploadIconState:[32]}],[0,"ap-ben-manage-benefits-header-row"],[0,"stencil-route",{group:[513],componentUpdated:[16],match:[1040],url:[1],component:[1],componentProps:[16],exact:[4],routeRender:[16],scrollTopOffset:[2,"scroll-top-offset"],routeViewsUpdated:[16],location:[16],history:[16],historyType:[1,"history-type"]}],[0,"ap-ben-file-icon",{fileType:[1,"file-type"],isEmpty:[4,"is-empty"]}]]],["p-cd0073f4.system",[[4,"stencil-route-link",{url:[1],urlMatch:[1,"url-match"],activeClass:[1,"active-class"],exact:[4],strict:[4],custom:[1],anchorClass:[1,"anchor-class"],anchorRole:[1,"anchor-role"],anchorTitle:[1,"anchor-title"],anchorTabIndex:[1,"anchor-tab-index"],anchorId:[1,"anchor-id"],history:[16],location:[16],root:[1],ariaHaspopup:[1,"aria-haspopup"],ariaPosinset:[1,"aria-posinset"],ariaSetsize:[2,"aria-setsize"],ariaLabel:[1,"aria-label"],match:[32]}],[4,"stencil-route-switch",{group:[513],scrollTopOffset:[2,"scroll-top-offset"],location:[16],routeViewsUpdated:[16]}],[4,"stencil-router",{root:[1],historyType:[1,"history-type"],titleSuffix:[1,"title-suffix"],scrollTopOffset:[2,"scroll-top-offset"],location:[32],history:[32]}],[0,"ap-ben-edit-benefit-page",{benefitId:[16],editMode:[32],selectedBenefit:[32],draftBenefit:[32],showDeleteConfirmDialog:[32],showCancelConfirmDialog:[32],isLoading:[32],isValidationDisplayed:[32]}],[0,"ap-ben-manage-page",{showDisabledBenefits:[32],pageState:[32],isLoading:[32]}]]],["p-08f08988.system",[[1,"benefits-app",{jwt:[1],apiBaseUrl:[1,"api-base-url"],appBaseUrl:[1,"app-base-url"],location:[16],history:[16],areStylesLoaded:[32],user:[32],signedInUserRole:[32]}],[0,"ap-ben-loading-page"]]]],e)}))}}}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,t,n,r){function s(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,a){function i(e){try{o(r.next(e))}catch(e){a(e)}}function c(e){try{o(r["throw"](e))}catch(e){a(e)}}function o(e){e.done?n(e.value):s(e.value).then(i,c)}o((r=r.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,s,a,i;return i={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function c(e){return function(t){return o([e,t])}}function o(i){if(r)throw new TypeError("Generator is already executing.");while(n)try{if(r=1,s&&(a=i[0]&2?s["return"]:i[0]?s["throw"]||((a=s["return"])&&a.call(s),0):s.next)&&!(a=a.call(s,i[1])).done)return a;if(s=0,a)i=[i[0]&2,a.value];switch(i[0]){case 0:case 1:a=i;break;case 4:n.label++;return{value:i[1],done:false};case 5:n.label++;s=i[1];i=[0];continue;case 7:i=n.ops.pop();n.trys.pop();continue;default:if(!(a=n.trys,a=a.length>0&&a[a.length-1])&&(i[0]===6||i[0]===2)){n=0;continue}if(i[0]===3&&(!a||i[1]>a[0]&&i[1]<a[3])){n.label=i[1];break}if(i[0]===6&&n.label<a[1]){n.label=a[1];a=i;break}if(a&&n.label<a[2]){n.label=a[2];n.ops.push(i);break}if(a[2])n.ops.pop();n.trys.pop();continue}i=t.call(e,n)}catch(e){i=[6,e];s=0}finally{r=a=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:true}}};System.register(["./p-6c8594d0.system.js","./p-8d4bb973.system.js","./p-835322bf.system.js","./p-9a8c9350.system.js","./p-19b00569.system.js","./p-6efcc4fd.system.js","./p-0eebae53.system.js","./p-d19c8a5d.system.js"],(function(e){"use strict";var t,n,r,s,a;return{setters:[function(e){t=e.r;n=e.h;r=e.H},function(e){s=e.o;a=e.a},function(){},function(){},function(){},function(){},function(){},function(){}],execute:function(){var i=e("ap_ben_oidc_callback_page",function(){function e(e){t(this,e)}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:e=this.callbackMode;switch(e){case"sign-in":return[3,1];case"sign-out":return[3,3];case"silent-refresh":return[3,5]}return[3,7];case 1:return[4,s.signInRedirectCallbackAsync()];case 2:t.sent();this.navigateToHomePage();return[3,7];case 3:return[4,s.signOutRedirectCallbackAsync()];case 4:t.sent();return[3,7];case 5:return[4,s.silentRefreshCallbackAsync()];case 6:t.sent();return[3,7];case 7:return[2]}}))}))};e.prototype.render=function(){return n(r,null)};e.prototype.navigateToHomePage=function(){this.history.replace(a.getAppRootUrl())};return e}())}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,t,n,i){function r(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i["throw"](e))}catch(e){o(e)}}function c(e){e.done?n(e.value):r(e.value).then(a,s)}c((i=i.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,r,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(e){return function(t){return c([e,t])}}function c(a){if(i)throw new TypeError("Generator is already executing.");while(n)try{if(i=1,r&&(o=a[0]&2?r["return"]:a[0]?r["throw"]||((o=r["return"])&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;if(r=0,o)a=[a[0]&2,o.value];switch(a[0]){case 0:case 1:o=a;break;case 4:n.label++;return{value:a[1],done:false};case 5:n.label++;r=a[1];a=[0];continue;case 7:a=n.ops.pop();n.trys.pop();continue;default:if(!(o=n.trys,o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){n=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){n.label=a[1];break}if(a[0]===6&&n.label<o[1]){n.label=o[1];o=a;break}if(o&&n.label<o[2]){n.label=o[2];n.ops.push(a);break}if(o[2])n.ops.pop();n.trys.pop();continue}a=t.call(e,n)}catch(e){a=[6,e];r=0}finally{i=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};System.register(["./p-6c8594d0.system.js","./p-9a8c9350.system.js","./p-0045ce79.system.js","./p-3a775d36.system.js","./p-f91aa986.system.js","./p-6efcc4fd.system.js","./p-62fe72dc.system.js","./p-835322bf.system.js","./p-348f3d3c.system.js","./p-0b08c63c.system.js","./p-0eebae53.system.js","./p-d19c8a5d.system.js","./p-69cf2679.system.js","./p-01cc3fd8.system.js","./p-78c4dce3.system.js"],(function(e){"use strict";var t,n,i,r,o,a,s,c,l,u,f,h,d,p,v,b,g,y,m,w,B,C,_,T,x,S,D,O;return{setters:[function(e){t=e.r;n=e.h;i=e.H;r=e.d;o=e.e},function(e){a=e.n;s=e.c},function(e){c=e.a},function(e){l=e.n;u=e.M;f=e.A;h=e.E},function(e){d=e.e;p=e.a;v=e.m;b=e.b;g=e.c;y=e.s;m=e.d;w=e.f;B=e.g;C=e.h;_=e.i;T=e.j;x=e.k;S=e.l},function(e){D=e.a},function(e){O=e.A},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){}],execute:function(){var k=e("ap_ben_edit_benefit_page",function(){function e(e){t(this,e);this.benefitId=a;this.showDeleteConfirmDialog=false;this.showCancelConfirmDialog=false;this.isLoading=false;this.isValidationDisplayed=false;this.stateSubscription=new D}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,this.initialiseAsync()];case 1:e.sent();return[2]}}))}))};e.prototype.disconnectedCallback=function(){this.stateSubscription.unsubscribe()};e.prototype.render=function(){return n(i,{class:"w-100"},n("ap-ben-ui-container",{class:"w-100 d-none"},n("div",{class:"row my-5"},n("div",{class:"uiid-new-edit-delete-benefit-page col-12"},n("h3",null,this.editMode==="add"?"New Benefit":"Edit Benefit"),n("ap-ben-edit-benefit-form",{class:"d-block mt-4 mb-3",disabled:this.isLoading,isValidationDisplayed:this.isValidationDisplayed}),this.renderActionBar()))),this.showDeleteConfirmDialog&&this.renderDeleteConfirmDialog(),this.showCancelConfirmDialog&&this.renderCancelConfirmDialog())};e.prototype.renderActionBar=function(){var e=this;return n("div",{class:"row"},n("div",{class:"col-12 d-flex"},n("button",{hidden:this.editMode==="add",class:"uiid-delete-benefit-item btn btn-outline-danger",onClick:function(t){e.showDeleteConfirmDialog=true}},"Delete"),n("div",{class:"ml-auto"},n("button",{class:"btn btn-light mr-3",onClick:function(t){return e.onCancelClicked()}},"Cancel"),n("button",{class:"uiid-publish-benefit btn btn-primary",onClick:function(t){return e.publishBenefit()},disabled:this.isLoading},"Publish"))))};e.prototype.renderDeleteConfirmDialog=function(){var e=this;return n("ap-ben-modal-section",{show:this.showDeleteConfirmDialog,showHeader:true,modalTitle:"Delete benefit",onModalClosed:function(t){e.showDeleteConfirmDialog=false}},n("ap-ben-confirm-dialog",{acceptText:"Delete",declineText:"Cancel",dialogStyle:"danger",onAccepted:function(t){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,this.deleteBenefitAsync()];case 1:e.sent();this.showDeleteConfirmDialog=false;return[2]}}))}))},onDeclined:function(t){e.showDeleteConfirmDialog=false}},n("p",null,n("strong",null,'"',c(this.selectedBenefit).title.value,'"')," will be permanently deleted from your benefits. Are you sure you want to delete it?")))};e.prototype.renderCancelConfirmDialog=function(){var e=this;return n("ap-ben-modal-section",{show:this.showCancelConfirmDialog,showHeader:true,modalTitle:"Unsaved changes",onModalClosed:function(t){e.showCancelConfirmDialog=false}},n("ap-ben-confirm-dialog",{acceptText:"Publish",declineText:"Discard",dialogStyle:"warning",onAccepted:function(t){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:this.showCancelConfirmDialog=false;return[4,this.publishBenefit()];case 1:e.sent();return[2]}}))}))},onDeclined:function(t){e.showCancelConfirmDialog=false;e.navigateToManageBenefits()}},this.editMode==="add"?"Do you want to save your new benefit?":n("p",null,n("strong",null,'"',c(this.selectedBenefit).title.value,'"')," has been modified. Do you want to publish your changes?")))};e.prototype.initialiseAsync=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){this.stateSubscription.add(d.isLoading$.subscribe((function(t){return e.isLoading=t})));this.stateSubscription.add(d.selectedBenefit$.subscribe((function(t){return e.selectedBenefit=t})));this.stateSubscription.add(d.draftBenefit$.subscribe((function(t){return e.draftBenefit=t})));if(s(this.benefitId)){this.editMode="edit";p.loadExistingBenefitForEditingAsync(this.benefitId.value)}else{p.createDraftBenefit();this.editMode="add"}return[2]}))}))};e.prototype.navigateToManageBenefits=function(){p.clearDraftBenefit();l.navigateInternally(u)};e.prototype.publishBenefit=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:if(!c(this.draftBenefit).isValid){this.isValidationDisplayed=true;return[2]}if(!c(this.draftBenefit).isDirty)return[3,2];return[4,p.publishDraftBenefitAsync()];case 1:e.sent();e.label=2;case 2:this.navigateToManageBenefits();return[2]}}))}))};e.prototype.onCancelClicked=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){if(!c(this.draftBenefit).isDirty){this.navigateToManageBenefits();return[2]}this.showCancelConfirmDialog=true;return[2]}))}))};e.prototype.deleteBenefitAsync=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,p.deleteSelectedBenefitAsync()];case 1:e.sent();this.navigateToManageBenefits();return[2]}}))}))};return e}());var P="manage-page .benefits-zero-state{height:32rem}";var A=e("ap_ben_manage_page",function(){function e(e){t(this,e);this.showDisabledBenefits=false;this.storeSubscription=new D}e.prototype.componentWillLoad=function(){var e=this;v.loadPageStateAsync();this.storeSubscription.add(b.manageBenefitsPageState$.subscribe((function(t){return e.pageState=t})));this.storeSubscription.add(b.isLoading$.subscribe((function(t){return e.isLoading=t})))};e.prototype.disconnectedCallback=function(){this.storeSubscription.unsubscribe()};e.prototype.render=function(){var e=this;if(this.isLoading){return n(i,{class:"w-100 text-center mt-5"},n("ap-ben-ui-container",{class:"w-100 d-none"},n("fl-loading-indicator",null)))}return n(i,{class:"w-100"},n("ap-ben-ui-container",{class:"w-100 d-none"},this.managedBenefitHeader(),n("div",{class:"uiid-manage-benefit-body row bg-white border-left border-right border-bottom mb-5 mx-0 rounded no-gutters"},n("div",{class:"col-12"},this.pageState.enabledBenefits.length===0?n("ap-ben-empty-benefits",{onNewBenefitButtonClicked:function(){return e.addBenefit()}}):this.ActiveBenefitsSection(),this.ToggleInactiveBenefitsRow(),this.showDisabledBenefits&&this.InactiveBenefitsSection()))))};e.prototype.ActiveBenefitsSection=function(){var e=this;return[n("ap-ben-manage-benefits-header-row",{class:"d-none d-md-block"}),this.pageState.enabledBenefits.map((function(t){return n("ap-ben-managed-benefit-item",{benefit:t,onEditBenefitButtonClicked:function(t){return e.editBenefit(t.detail)}})}))]};e.prototype.ToggleInactiveBenefitsRow=function(){var e=this;return n("div",{class:"col-12 py-3 border-top d-flex justify-content-center"},n("button",{class:"uiid-show-inactive-benefit-item btn btn-link",onClick:function(t){return e.onToggleInactiveBenefits()}},n("h6",{class:"m-0"},this.showDisabledBenefits?"Hide inactive benefits ("+this.pageState.disabledBenefits.length+")":"Show inactive ("+this.pageState.disabledBenefits.length+")")))};e.prototype.InactiveBenefitsSection=function(){var e=this;if(this.pageState.disabledBenefits.length===0){return[n("div",{class:"row border-top py-3 px-3 d-flex align-items-center no-gutters"},n("div",{class:"col-12 my-1 d-flex justify-content-center"},n("span",{class:"text-muted"},"No inactive benefits.")))]}return this.pageState.disabledBenefits.map((function(t){return n("ap-ben-managed-benefit-item",{benefit:t,onEditBenefitButtonClicked:function(t){return e.editBenefit(t.detail)}})}))};e.prototype.managedBenefitHeader=function(){var e=this;return n("div",{class:"uiid-manage-benefit-header row mb-3 mt-5"},n("div",{class:"col-12 col-sm-6"},n("h3",null,"Manage Benefits")),n("div",{class:"col-12 col-sm-6 d-flex justify-content-end align-items-center"},n("fl-button",{class:"uiid-new-benefit-button",onClick:function(t){return e.addBenefit()}},n("ap-ben-icon",{class:"mr-2",iconPrefix:"far",iconId:"plus"}),"New benefit")))};e.prototype.onToggleInactiveBenefits=function(){this.showDisabledBenefits=!this.showDisabledBenefits};e.prototype.addBenefit=function(){l.navigateInternally(f)};e.prototype.editBenefit=function(e){l.navigateInternally(h+"/"+e.id)};return e}());A.style=P;var j=function(e,t,n){return n(e.confirm(t))};var L=function(e){return e.metaKey||e.altKey||e.ctrlKey||e.shiftKey};var E=function(e){var t=e.navigator.userAgent;if((t.indexOf("Android 2.")!==-1||t.indexOf("Android 4.0")!==-1)&&t.indexOf("Mobile Safari")!==-1&&t.indexOf("Chrome")===-1&&t.indexOf("Windows Phone")===-1){return false}return e.history&&"pushState"in e.history};var I=function(e){return e.userAgent.indexOf("Trident")===-1};var M=function(e){return e.userAgent.indexOf("Firefox")===-1};var U=function(e,t){return t.state===undefined&&e.userAgent.indexOf("CriOS")===-1};var H=function(e,t){var n=e[t];var i="__storage_test__";try{n.setItem(i,i);n.removeItem(i);return true}catch(e){return e instanceof DOMException&&(e.code===22||e.code===1014||e.name==="QuotaExceededError"||e.name==="NS_ERROR_DOM_QUOTA_REACHED")&&n.length!==0}};var R=function(e,t){if(e.charAt(0)=="/"&&t.charAt(t.length-1)=="/"){return t.slice(0,t.length-1)+e}return t+e};var V=e("stencil_route_link",function(){function e(e){t(this,e);this.unsubscribe=function(){return};this.activeClass="link-active";this.exact=false;this.strict=true;this.custom="a";this.match=null}e.prototype.componentWillLoad=function(){this.computeMatch()};e.prototype.computeMatch=function(){if(this.location){this.match=g(this.location.pathname,{path:this.urlMatch||this.url,exact:this.exact,strict:this.strict})}};e.prototype.handleClick=function(e){if(L(e)||!this.history||!this.url||!this.root){return}e.preventDefault();return this.history.push(R(this.url,this.root))};e.prototype.render=function(){var e;var t={class:(e={},e[this.activeClass]=this.match!==null,e),onClick:this.handleClick.bind(this)};if(this.anchorClass){t.class[this.anchorClass]=true}if(this.custom==="a"){t=Object.assign({},t,{href:this.url,title:this.anchorTitle,role:this.anchorRole,tabindex:this.anchorTabIndex,"aria-haspopup":this.ariaHaspopup,id:this.anchorId,"aria-posinset":this.ariaPosinset,"aria-setsize":this.ariaSetsize,"aria-label":this.ariaLabel})}return n(this.custom,Object.assign({},t),n("slot",null))};Object.defineProperty(e.prototype,"el",{get:function(){return r(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{location:["computeMatch"]}},enumerable:false,configurable:true});return e}());O.injectProps(V,["history","location","root"]);var N=function(){return((Math.random()*1e17).toString().match(/.{4}/g)||[]).join("-")};var q=function(e,t,n){return g(e,{path:t,exact:n,strict:true})};var W=function(e){return e.tagName==="STENCIL-ROUTE"};var Y=e("stencil_route_switch",function(){function e(e){t(this,e);this.group=N();this.subscribers=[];this.queue=o(this,"queue")}e.prototype.componentWillLoad=function(){if(this.location!=null){this.regenerateSubscribers(this.location)}};e.prototype.regenerateSubscribers=function(e){return __awaiter(this,void 0,void 0,(function(){var t,n;var i=this;return __generator(this,(function(r){if(e==null){return[2]}t=-1;this.subscribers=Array.prototype.slice.call(this.el.children).filter(W).map((function(n,i){var r=q(e.pathname,n.url,n.exact);if(r&&t===-1){t=i}return{el:n,match:r}}));if(t===-1){return[2]}if(this.activeIndex===t){this.subscribers[t].el.match=this.subscribers[t].match;return[2]}this.activeIndex=t;n=this.subscribers[this.activeIndex];if(this.scrollTopOffset){n.el.scrollTopOffset=this.scrollTopOffset}n.el.group=this.group;n.el.match=n.match;n.el.componentUpdated=function(e){i.queue.write((function(){i.subscribers.forEach((function(e,t){e.el.componentUpdated=undefined;if(t===i.activeIndex){return e.el.style.display=""}if(i.scrollTopOffset){e.el.scrollTopOffset=i.scrollTopOffset}e.el.group=i.group;e.el.match=null;e.el.style.display="none"}))}));if(i.routeViewsUpdated){i.routeViewsUpdated(Object.assign({scrollTopOffset:i.scrollTopOffset},e))}};return[2]}))}))};e.prototype.render=function(){return n("slot",null)};Object.defineProperty(e.prototype,"el",{get:function(){return r(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{location:["regenerateSubscribers"]}},enumerable:false,configurable:true});return e}());O.injectProps(Y,["location","routeViewsUpdated"]);var $=function(e){var t=[];for(var n=1;n<arguments.length;n++){t[n-1]=arguments[n]}if(!e){console.warn.apply(console,t)}};var F=function(){var e;var t=[];var n=function(t){$(e==null,"A history supports only one prompt at a time");e=t;return function(){if(e===t){e=null}}};var i=function(t,n,i,r){if(e!=null){var o=typeof e==="function"?e(t,n):e;if(typeof o==="string"){if(typeof i==="function"){i(o,r)}else{$(false,"A history needs a getUserConfirmation function in order to use a prompt message");r(true)}}else{r(o!==false)}}else{r(true)}};var r=function(e){var n=true;var i=function(){var t=[];for(var i=0;i<arguments.length;i++){t[i]=arguments[i]}if(n){e.apply(void 0,t)}};t.push(i);return function(){n=false;t=t.filter((function(e){return e!==i}))}};var o=function(){var e=[];for(var n=0;n<arguments.length;n++){e[n]=arguments[n]}t.forEach((function(t){return t.apply(void 0,e)}))};return{setPrompt:n,confirmTransitionTo:i,appendListener:r,notifyListeners:o}};var K=function(e,t){if(t===void 0){t="scrollPositions"}var n=new Map;var i=function(t,i){n.set(t,i);if(H(e,"sessionStorage")){var r=[];n.forEach((function(e,t){r.push([t,e])}));e.sessionStorage.setItem("scrollPositions",JSON.stringify(r))}};var r=function(e){return n.get(e)};var o=function(e){return n.has(e)};var a=function(t){i(t,[e.scrollX,e.scrollY])};if(H(e,"sessionStorage")){var s=e.sessionStorage.getItem(t);n=s?new Map(JSON.parse(s)):n}if("scrollRestoration"in e.history){history.scrollRestoration="manual"}return{set:i,get:r,has:o,capture:a}};var z="popstate";var J="hashchange";var Q=function(e,t){if(t===void 0){t={}}var n=false;var i=e.history;var r=e.location;var o=e.navigator;var a=E(e);var s=!I(o);var c=K(e);var l=t.forceRefresh!=null?t.forceRefresh:false;var u=t.getUserConfirmation!=null?t.getUserConfirmation:j;var f=t.keyLength!=null?t.keyLength:6;var h=t.basename?y(m(t.basename)):"";var d=function(){try{return e.history.state||{}}catch(e){return{}}};var p=function(e){e=e||{};var t=e.key,n=e.state;var i=r.pathname,o=r.search,a=r.hash;var s=i+o+a;$(!h||C(s,h),"You are attempting to use a basename on a page whose URL path does not begin "+'with the basename. Expected path "'+s+'" to begin with "'+h+'".');if(h){s=_(s,h)}return w(s,n,t||B(f))};var v=F();var b=function(e){c.capture(Q.location.key);Object.assign(Q,e);Q.location.scrollPosition=c.get(Q.location.key);Q.length=i.length;v.notifyListeners(Q.location,Q.action)};var g=function(e){if(!U(o,e)){S(p(e.state))}};var x=function(){S(p(d()))};var S=function(e){if(n){n=false;b()}else{var t="POP";v.confirmTransitionTo(e,t,u,(function(n){if(n){b({action:t,location:e})}else{D(e)}}))}};var D=function(e){var t=Q.location;var i=k.indexOf(t.key);var r=k.indexOf(e.key);if(i===-1){i=0}if(r===-1){r=0}var o=i-r;if(o){n=true;R(o)}};var O=p(d());var k=[O.key];var P=0;var A=false;var L=function(e){return h+T(e)};var M=function(e,t){$(!(typeof e==="object"&&e.state!==undefined&&t!==undefined),"You should avoid providing a 2nd state argument to push when the 1st "+"argument is a location-like object that already has state; it is ignored");var n="PUSH";var o=w(e,t,B(f),Q.location);v.confirmTransitionTo(o,n,u,(function(e){if(!e){return}var t=L(o);var s=o.key,c=o.state;if(a){i.pushState({key:s,state:c},"",t);if(l){r.href=t}else{var u=k.indexOf(Q.location.key);var f=k.slice(0,u===-1?0:u+1);f.push(o.key);k=f;b({action:n,location:o})}}else{$(c===undefined,"Browser history cannot push state in browsers that do not support HTML5 history");r.href=t}}))};var H=function(e,t){$(!(typeof e==="object"&&e.state!==undefined&&t!==undefined),"You should avoid providing a 2nd state argument to replace when the 1st "+"argument is a location-like object that already has state; it is ignored");var n="REPLACE";var o=w(e,t,B(f),Q.location);v.confirmTransitionTo(o,n,u,(function(e){if(!e){return}var t=L(o);var s=o.key,c=o.state;if(a){i.replaceState({key:s,state:c},"",t);if(l){r.replace(t)}else{var u=k.indexOf(Q.location.key);if(u!==-1){k[u]=o.key}b({action:n,location:o})}}else{$(c===undefined,"Browser history cannot replace state in browsers that do not support HTML5 history");r.replace(t)}}))};var R=function(e){i.go(e)};var V=function(){return R(-1)};var N=function(){return R(1)};var q=function(t){P+=t;if(P===1){e.addEventListener(z,g);if(s){e.addEventListener(J,x)}}else if(P===0){e.removeEventListener(z,g);if(s){e.removeEventListener(J,x)}}};var W=function(e){if(e===void 0){e=""}var t=v.setPrompt(e);if(!A){q(1);A=true}return function(){if(A){A=false;q(-1)}return t()}};var Y=function(e){var t=v.appendListener(e);q(1);return function(){q(-1);t()}};var Q={length:i.length,action:"POP",location:O,createHref:L,push:M,replace:H,go:R,goBack:V,goForward:N,block:W,listen:Y,win:e};return Q};var G="hashchange";var X={hashbang:{encodePath:function(e){return e.charAt(0)==="!"?e:"!/"+x(e)},decodePath:function(e){return e.charAt(0)==="!"?e.substr(1):e}},noslash:{encodePath:x,decodePath:m},slash:{encodePath:m,decodePath:m}};var Z=function(e,t){if(t===void 0){t={}}var n=false;var i=null;var r=0;var o=false;var a=e.location;var s=e.history;var c=M(e.navigator);var l=t.keyLength!=null?t.keyLength:6;var u=t.getUserConfirmation,f=u===void 0?j:u,h=t.hashType,d=h===void 0?"slash":h;var p=t.basename?y(m(t.basename)):"";var v=X[d],b=v.encodePath,g=v.decodePath;var x=function(){var e=a.href;var t=e.indexOf("#");return t===-1?"":e.substring(t+1)};var D=function(e){return a.hash=e};var O=function(e){var t=a.href.indexOf("#");a.replace(a.href.slice(0,t>=0?t:0)+"#"+e)};var k=function(){var e=g(x());$(!p||C(e,p),"You are attempting to use a basename on a page whose URL path does not begin "+'with the basename. Expected path "'+e+'" to begin with "'+p+'".');if(p){e=_(e,p)}return w(e,undefined,B(l))};var P=F();var A=function(e){Object.assign(ee,e);ee.length=s.length;P.notifyListeners(ee.location,ee.action)};var L=function(){var e=x();var t=b(e);if(e!==t){O(t)}else{var r=k();var o=ee.location;if(!n&&S(o,r)){return}if(i===T(r)){return}i=null;E(r)}};var E=function(e){if(n){n=false;A()}else{var t="POP";P.confirmTransitionTo(e,t,f,(function(n){if(n){A({action:t,location:e})}else{I(e)}}))}};var I=function(e){var t=ee.location;var i=V.lastIndexOf(T(t));var r=V.lastIndexOf(T(e));if(i===-1){i=0}if(r===-1){r=0}var o=i-r;if(o){n=true;Y(o)}};var U=x();var H=b(U);if(U!==H){O(H)}var R=k();var V=[T(R)];var N=function(e){return"#"+b(p+T(e))};var q=function(e,t){$(t===undefined,"Hash history cannot push state; it is ignored");var n="PUSH";var r=w(e,undefined,B(l),ee.location);P.confirmTransitionTo(r,n,f,(function(e){if(!e){return}var t=T(r);var o=b(p+t);var a=x()!==o;if(a){i=t;D(o);var s=V.lastIndexOf(T(ee.location));var c=V.slice(0,s===-1?0:s+1);c.push(t);V=c;A({action:n,location:r})}else{$(false,"Hash history cannot PUSH the same path; a new entry will not be added to the history stack");A()}}))};var W=function(e,t){$(t===undefined,"Hash history cannot replace state; it is ignored");var n="REPLACE";var r=w(e,undefined,B(l),ee.location);P.confirmTransitionTo(r,n,f,(function(e){if(!e){return}var t=T(r);var o=b(p+t);var a=x()!==o;if(a){i=t;O(o)}var s=V.indexOf(T(ee.location));if(s!==-1){V[s]=t}A({action:n,location:r})}))};var Y=function(e){$(c,"Hash history go(n) causes a full page reload in this browser");s.go(e)};var K=function(){return Y(-1)};var z=function(){return Y(1)};var J=function(e,t){r+=t;if(r===1){e.addEventListener(G,L)}else if(r===0){e.removeEventListener(G,L)}};var Q=function(t){if(t===void 0){t=""}var n=P.setPrompt(t);if(!o){J(e,1);o=true}return function(){if(o){o=false;J(e,-1)}return n()}};var Z=function(t){var n=P.appendListener(t);J(e,1);return function(){J(e,-1);n()}};var ee={length:s.length,action:"POP",location:R,createHref:N,push:q,replace:W,go:Y,goBack:K,goForward:z,block:Q,listen:Z,win:e};return ee};var ee=function(e,t){var n=e.pathname.indexOf(t)==0?"/"+e.pathname.slice(t.length):e.pathname;return Object.assign({},e,{pathname:n})};var te={browser:Q,hash:Z};var ne=e("stencil_router",function(){function e(e){var n=this;t(this,e);this.root="/";this.historyType="browser";this.titleSuffix="";this.routeViewsUpdated=function(e){if(e===void 0){e={}}if(n.history&&e.scrollToId&&n.historyType==="browser"){var t=n.history.win.document.getElementById(e.scrollToId);if(t){return t.scrollIntoView()}}n.scrollTo(e.scrollTopOffset||n.scrollTopOffset)};this.isServer=o(this,"isServer");this.queue=o(this,"queue")}e.prototype.componentWillLoad=function(){var e=this;this.history=te[this.historyType](this.el.ownerDocument.defaultView);this.history.listen((function(t){t=ee(t,e.root);e.location=t}));this.location=ee(this.history.location,this.root)};e.prototype.scrollTo=function(e){var t=this.history;if(e==null||this.isServer||!t){return}if(t.action==="POP"&&Array.isArray(t.location.scrollPosition)){return this.queue.write((function(){if(t&&t.location&&Array.isArray(t.location.scrollPosition)){t.win.scrollTo(t.location.scrollPosition[0],t.location.scrollPosition[1])}}))}return this.queue.write((function(){t.win.scrollTo(0,e)}))};e.prototype.render=function(){if(!this.location||!this.history){return}var e={historyType:this.historyType,location:this.location,titleSuffix:this.titleSuffix,root:this.root,history:this.history,routeViewsUpdated:this.routeViewsUpdated};return n(O.Provider,{state:e},n("slot",null))};Object.defineProperty(e.prototype,"el",{get:function(){return r(this)},enumerable:false,configurable:true});return e}())}}}));
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,t,n,i){function r(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i["throw"](e))}catch(e){o(e)}}function c(e){e.done?n(e.value):r(e.value).then(a,s)}c((i=i.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,r,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(e){return function(t){return c([e,t])}}function c(a){if(i)throw new TypeError("Generator is already executing.");while(n)try{if(i=1,r&&(o=a[0]&2?r["return"]:a[0]?r["throw"]||((o=r["return"])&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;if(r=0,o)a=[a[0]&2,o.value];switch(a[0]){case 0:case 1:o=a;break;case 4:n.label++;return{value:a[1],done:false};case 5:n.label++;r=a[1];a=[0];continue;case 7:a=n.ops.pop();n.trys.pop();continue;default:if(!(o=n.trys,o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){n=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){n.label=a[1];break}if(a[0]===6&&n.label<o[1]){n.label=o[1];o=a;break}if(o&&n.label<o[2]){n.label=o[2];n.ops.push(a);break}if(o[2])n.ops.pop();n.trys.pop();continue}a=t.call(e,n)}catch(e){a=[6,e];r=0}finally{i=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};System.register(["./p-6c8594d0.system.js","./p-9a8c9350.system.js","./p-0045ce79.system.js","./p-3a775d36.system.js","./p-6339bd49.system.js","./p-6efcc4fd.system.js","./p-62fe72dc.system.js","./p-835322bf.system.js","./p-348f3d3c.system.js","./p-19b00569.system.js","./p-0eebae53.system.js","./p-d19c8a5d.system.js","./p-45d6fbc2.system.js","./p-01cc3fd8.system.js","./p-b41f72c8.system.js"],(function(e){"use strict";var t,n,i,r,o,a,s,c,l,u,f,h,d,p,v,b,g,y,m,w,B,C,_,T,x,S,D,O;return{setters:[function(e){t=e.r;n=e.h;i=e.H;r=e.d;o=e.e},function(e){a=e.n;s=e.c},function(e){c=e.a},function(e){l=e.n;u=e.M;f=e.A;h=e.E},function(e){d=e.e;p=e.a;v=e.m;b=e.b;g=e.c;y=e.s;m=e.d;w=e.f;B=e.g;C=e.h;_=e.i;T=e.j;x=e.k;S=e.l},function(e){D=e.a},function(e){O=e.A},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){}],execute:function(){var k=e("ap_ben_edit_benefit_page",function(){function e(e){t(this,e);this.benefitId=a;this.showDeleteConfirmDialog=false;this.showCancelConfirmDialog=false;this.isLoading=false;this.isValidationDisplayed=false;this.stateSubscription=new D}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,this.initialiseAsync()];case 1:e.sent();return[2]}}))}))};e.prototype.disconnectedCallback=function(){this.stateSubscription.unsubscribe()};e.prototype.render=function(){return n(i,{class:"w-100"},n("ap-ben-ui-container",{class:"w-100 d-none"},n("div",{class:"row my-5"},n("div",{class:"uiid-new-edit-delete-benefit-page col-12"},n("h3",null,this.editMode==="add"?"New Benefit":"Edit Benefit"),n("ap-ben-edit-benefit-form",{class:"d-block mt-4 mb-3",disabled:this.isLoading,isValidationDisplayed:this.isValidationDisplayed}),this.renderActionBar()))),this.showDeleteConfirmDialog&&this.renderDeleteConfirmDialog(),this.showCancelConfirmDialog&&this.renderCancelConfirmDialog())};e.prototype.renderActionBar=function(){var e=this;return n("div",{class:"row"},n("div",{class:"col-12 d-flex"},n("button",{hidden:this.editMode==="add",class:"uiid-delete-benefit-item btn btn-outline-danger",onClick:function(t){e.showDeleteConfirmDialog=true}},"Delete"),n("div",{class:"ml-auto"},n("button",{class:"btn btn-light mr-3",onClick:function(t){return e.onCancelClicked()}},"Cancel"),n("button",{class:"uiid-publish-benefit btn btn-primary",onClick:function(t){return e.publishBenefit()},disabled:this.isLoading},"Publish"))))};e.prototype.renderDeleteConfirmDialog=function(){var e=this;return n("ap-ben-modal-section",{show:this.showDeleteConfirmDialog,showHeader:true,modalTitle:"Delete benefit",onModalClosed:function(t){e.showDeleteConfirmDialog=false}},n("ap-ben-confirm-dialog",{acceptText:"Delete",declineText:"Cancel",dialogStyle:"danger",onAccepted:function(t){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,this.deleteBenefitAsync()];case 1:e.sent();this.showDeleteConfirmDialog=false;return[2]}}))}))},onDeclined:function(t){e.showDeleteConfirmDialog=false}},n("p",null,n("strong",null,'"',c(this.selectedBenefit).title.value,'"')," will be permanently deleted from your benefits. Are you sure you want to delete it?")))};e.prototype.renderCancelConfirmDialog=function(){var e=this;return n("ap-ben-modal-section",{show:this.showCancelConfirmDialog,showHeader:true,modalTitle:"Unsaved changes",onModalClosed:function(t){e.showCancelConfirmDialog=false}},n("ap-ben-confirm-dialog",{acceptText:"Publish",declineText:"Discard",dialogStyle:"warning",onAccepted:function(t){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:this.showCancelConfirmDialog=false;return[4,this.publishBenefit()];case 1:e.sent();return[2]}}))}))},onDeclined:function(t){e.showCancelConfirmDialog=false;e.navigateToManageBenefits()}},this.editMode==="add"?"Do you want to save your new benefit?":n("p",null,n("strong",null,'"',c(this.selectedBenefit).title.value,'"')," has been modified. Do you want to publish your changes?")))};e.prototype.initialiseAsync=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){this.stateSubscription.add(d.isLoading$.subscribe((function(t){return e.isLoading=t})));this.stateSubscription.add(d.selectedBenefit$.subscribe((function(t){return e.selectedBenefit=t})));this.stateSubscription.add(d.draftBenefit$.subscribe((function(t){return e.draftBenefit=t})));if(s(this.benefitId)){this.editMode="edit";p.loadExistingBenefitForEditingAsync(this.benefitId.value)}else{p.createDraftBenefit();this.editMode="add"}return[2]}))}))};e.prototype.navigateToManageBenefits=function(){p.clearDraftBenefit();l.navigateInternally(u)};e.prototype.publishBenefit=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:if(!c(this.draftBenefit).isValid){this.isValidationDisplayed=true;return[2]}if(!c(this.draftBenefit).isDirty)return[3,2];return[4,p.publishDraftBenefitAsync()];case 1:e.sent();e.label=2;case 2:this.navigateToManageBenefits();return[2]}}))}))};e.prototype.onCancelClicked=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){if(!c(this.draftBenefit).isDirty){this.navigateToManageBenefits();return[2]}this.showCancelConfirmDialog=true;return[2]}))}))};e.prototype.deleteBenefitAsync=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,p.deleteSelectedBenefitAsync()];case 1:e.sent();this.navigateToManageBenefits();return[2]}}))}))};return e}());var P="manage-page .benefits-zero-state{height:32rem}";var A=e("ap_ben_manage_page",function(){function e(e){t(this,e);this.showDisabledBenefits=false;this.storeSubscription=new D}e.prototype.componentWillLoad=function(){var e=this;v.loadPageStateAsync();this.storeSubscription.add(b.manageBenefitsPageState$.subscribe((function(t){return e.pageState=t})));this.storeSubscription.add(b.isLoading$.subscribe((function(t){return e.isLoading=t})))};e.prototype.disconnectedCallback=function(){this.storeSubscription.unsubscribe()};e.prototype.render=function(){var e=this;if(this.isLoading){return n(i,{class:"w-100 text-center mt-5"},n("ap-ben-ui-container",{class:"w-100 d-none"},n("fl-loading-indicator",null)))}return n(i,{class:"w-100"},n("ap-ben-ui-container",{class:"w-100 d-none"},this.managedBenefitHeader(),n("div",{class:"uiid-manage-benefit-body row bg-white border-left border-right border-bottom mb-5 mx-0 rounded no-gutters"},n("div",{class:"col-12"},this.pageState.enabledBenefits.length===0?n("ap-ben-empty-benefits",{onNewBenefitButtonClicked:function(){return e.addBenefit()}}):this.ActiveBenefitsSection(),this.ToggleInactiveBenefitsRow(),this.showDisabledBenefits&&this.InactiveBenefitsSection()))))};e.prototype.ActiveBenefitsSection=function(){var e=this;return[n("ap-ben-manage-benefits-header-row",{class:"d-none d-md-block"}),this.pageState.enabledBenefits.map((function(t){return n("ap-ben-managed-benefit-item",{benefit:t,onEditBenefitButtonClicked:function(t){return e.editBenefit(t.detail)}})}))]};e.prototype.ToggleInactiveBenefitsRow=function(){var e=this;return n("div",{class:"col-12 py-3 border-top d-flex justify-content-center"},n("button",{class:"uiid-show-inactive-benefit-item btn btn-link",onClick:function(t){return e.onToggleInactiveBenefits()}},n("h6",{class:"m-0"},this.showDisabledBenefits?"Hide inactive benefits ("+this.pageState.disabledBenefits.length+")":"Show inactive ("+this.pageState.disabledBenefits.length+")")))};e.prototype.InactiveBenefitsSection=function(){var e=this;if(this.pageState.disabledBenefits.length===0){return[n("div",{class:"row border-top py-3 px-3 d-flex align-items-center no-gutters"},n("div",{class:"col-12 my-1 d-flex justify-content-center"},n("span",{class:"text-muted"},"No inactive benefits.")))]}return this.pageState.disabledBenefits.map((function(t){return n("ap-ben-managed-benefit-item",{benefit:t,onEditBenefitButtonClicked:function(t){return e.editBenefit(t.detail)}})}))};e.prototype.managedBenefitHeader=function(){var e=this;return n("div",{class:"uiid-manage-benefit-header row mb-3 mt-5"},n("div",{class:"col-12 col-sm-6"},n("h3",null,"Manage Benefits")),n("div",{class:"col-12 col-sm-6 d-flex justify-content-end align-items-center"},n("fl-button",{class:"uiid-new-benefit-button",onClick:function(t){return e.addBenefit()}},n("ap-ben-icon",{class:"mr-2",iconPrefix:"far",iconId:"plus"}),"New benefit")))};e.prototype.onToggleInactiveBenefits=function(){this.showDisabledBenefits=!this.showDisabledBenefits};e.prototype.addBenefit=function(){l.navigateInternally(f)};e.prototype.editBenefit=function(e){l.navigateInternally(h+"/"+e.id)};return e}());A.style=P;var j=function(e,t,n){return n(e.confirm(t))};var L=function(e){return e.metaKey||e.altKey||e.ctrlKey||e.shiftKey};var E=function(e){var t=e.navigator.userAgent;if((t.indexOf("Android 2.")!==-1||t.indexOf("Android 4.0")!==-1)&&t.indexOf("Mobile Safari")!==-1&&t.indexOf("Chrome")===-1&&t.indexOf("Windows Phone")===-1){return false}return e.history&&"pushState"in e.history};var I=function(e){return e.userAgent.indexOf("Trident")===-1};var M=function(e){return e.userAgent.indexOf("Firefox")===-1};var U=function(e,t){return t.state===undefined&&e.userAgent.indexOf("CriOS")===-1};var H=function(e,t){var n=e[t];var i="__storage_test__";try{n.setItem(i,i);n.removeItem(i);return true}catch(e){return e instanceof DOMException&&(e.code===22||e.code===1014||e.name==="QuotaExceededError"||e.name==="NS_ERROR_DOM_QUOTA_REACHED")&&n.length!==0}};var R=function(e,t){if(e.charAt(0)=="/"&&t.charAt(t.length-1)=="/"){return t.slice(0,t.length-1)+e}return t+e};var V=e("stencil_route_link",function(){function e(e){t(this,e);this.unsubscribe=function(){return};this.activeClass="link-active";this.exact=false;this.strict=true;this.custom="a";this.match=null}e.prototype.componentWillLoad=function(){this.computeMatch()};e.prototype.computeMatch=function(){if(this.location){this.match=g(this.location.pathname,{path:this.urlMatch||this.url,exact:this.exact,strict:this.strict})}};e.prototype.handleClick=function(e){if(L(e)||!this.history||!this.url||!this.root){return}e.preventDefault();return this.history.push(R(this.url,this.root))};e.prototype.render=function(){var e;var t={class:(e={},e[this.activeClass]=this.match!==null,e),onClick:this.handleClick.bind(this)};if(this.anchorClass){t.class[this.anchorClass]=true}if(this.custom==="a"){t=Object.assign({},t,{href:this.url,title:this.anchorTitle,role:this.anchorRole,tabindex:this.anchorTabIndex,"aria-haspopup":this.ariaHaspopup,id:this.anchorId,"aria-posinset":this.ariaPosinset,"aria-setsize":this.ariaSetsize,"aria-label":this.ariaLabel})}return n(this.custom,Object.assign({},t),n("slot",null))};Object.defineProperty(e.prototype,"el",{get:function(){return r(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{location:["computeMatch"]}},enumerable:false,configurable:true});return e}());O.injectProps(V,["history","location","root"]);var N=function(){return((Math.random()*1e17).toString().match(/.{4}/g)||[]).join("-")};var q=function(e,t,n){return g(e,{path:t,exact:n,strict:true})};var W=function(e){return e.tagName==="STENCIL-ROUTE"};var Y=e("stencil_route_switch",function(){function e(e){t(this,e);this.group=N();this.subscribers=[];this.queue=o(this,"queue")}e.prototype.componentWillLoad=function(){if(this.location!=null){this.regenerateSubscribers(this.location)}};e.prototype.regenerateSubscribers=function(e){return __awaiter(this,void 0,void 0,(function(){var t,n;var i=this;return __generator(this,(function(r){if(e==null){return[2]}t=-1;this.subscribers=Array.prototype.slice.call(this.el.children).filter(W).map((function(n,i){var r=q(e.pathname,n.url,n.exact);if(r&&t===-1){t=i}return{el:n,match:r}}));if(t===-1){return[2]}if(this.activeIndex===t){this.subscribers[t].el.match=this.subscribers[t].match;return[2]}this.activeIndex=t;n=this.subscribers[this.activeIndex];if(this.scrollTopOffset){n.el.scrollTopOffset=this.scrollTopOffset}n.el.group=this.group;n.el.match=n.match;n.el.componentUpdated=function(e){i.queue.write((function(){i.subscribers.forEach((function(e,t){e.el.componentUpdated=undefined;if(t===i.activeIndex){return e.el.style.display=""}if(i.scrollTopOffset){e.el.scrollTopOffset=i.scrollTopOffset}e.el.group=i.group;e.el.match=null;e.el.style.display="none"}))}));if(i.routeViewsUpdated){i.routeViewsUpdated(Object.assign({scrollTopOffset:i.scrollTopOffset},e))}};return[2]}))}))};e.prototype.render=function(){return n("slot",null)};Object.defineProperty(e.prototype,"el",{get:function(){return r(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{location:["regenerateSubscribers"]}},enumerable:false,configurable:true});return e}());O.injectProps(Y,["location","routeViewsUpdated"]);var $=function(e){var t=[];for(var n=1;n<arguments.length;n++){t[n-1]=arguments[n]}if(!e){console.warn.apply(console,t)}};var F=function(){var e;var t=[];var n=function(t){$(e==null,"A history supports only one prompt at a time");e=t;return function(){if(e===t){e=null}}};var i=function(t,n,i,r){if(e!=null){var o=typeof e==="function"?e(t,n):e;if(typeof o==="string"){if(typeof i==="function"){i(o,r)}else{$(false,"A history needs a getUserConfirmation function in order to use a prompt message");r(true)}}else{r(o!==false)}}else{r(true)}};var r=function(e){var n=true;var i=function(){var t=[];for(var i=0;i<arguments.length;i++){t[i]=arguments[i]}if(n){e.apply(void 0,t)}};t.push(i);return function(){n=false;t=t.filter((function(e){return e!==i}))}};var o=function(){var e=[];for(var n=0;n<arguments.length;n++){e[n]=arguments[n]}t.forEach((function(t){return t.apply(void 0,e)}))};return{setPrompt:n,confirmTransitionTo:i,appendListener:r,notifyListeners:o}};var K=function(e,t){if(t===void 0){t="scrollPositions"}var n=new Map;var i=function(t,i){n.set(t,i);if(H(e,"sessionStorage")){var r=[];n.forEach((function(e,t){r.push([t,e])}));e.sessionStorage.setItem("scrollPositions",JSON.stringify(r))}};var r=function(e){return n.get(e)};var o=function(e){return n.has(e)};var a=function(t){i(t,[e.scrollX,e.scrollY])};if(H(e,"sessionStorage")){var s=e.sessionStorage.getItem(t);n=s?new Map(JSON.parse(s)):n}if("scrollRestoration"in e.history){history.scrollRestoration="manual"}return{set:i,get:r,has:o,capture:a}};var z="popstate";var J="hashchange";var Q=function(e,t){if(t===void 0){t={}}var n=false;var i=e.history;var r=e.location;var o=e.navigator;var a=E(e);var s=!I(o);var c=K(e);var l=t.forceRefresh!=null?t.forceRefresh:false;var u=t.getUserConfirmation!=null?t.getUserConfirmation:j;var f=t.keyLength!=null?t.keyLength:6;var h=t.basename?y(m(t.basename)):"";var d=function(){try{return e.history.state||{}}catch(e){return{}}};var p=function(e){e=e||{};var t=e.key,n=e.state;var i=r.pathname,o=r.search,a=r.hash;var s=i+o+a;$(!h||C(s,h),"You are attempting to use a basename on a page whose URL path does not begin "+'with the basename. Expected path "'+s+'" to begin with "'+h+'".');if(h){s=_(s,h)}return w(s,n,t||B(f))};var v=F();var b=function(e){c.capture(Q.location.key);Object.assign(Q,e);Q.location.scrollPosition=c.get(Q.location.key);Q.length=i.length;v.notifyListeners(Q.location,Q.action)};var g=function(e){if(!U(o,e)){S(p(e.state))}};var x=function(){S(p(d()))};var S=function(e){if(n){n=false;b()}else{var t="POP";v.confirmTransitionTo(e,t,u,(function(n){if(n){b({action:t,location:e})}else{D(e)}}))}};var D=function(e){var t=Q.location;var i=k.indexOf(t.key);var r=k.indexOf(e.key);if(i===-1){i=0}if(r===-1){r=0}var o=i-r;if(o){n=true;R(o)}};var O=p(d());var k=[O.key];var P=0;var A=false;var L=function(e){return h+T(e)};var M=function(e,t){$(!(typeof e==="object"&&e.state!==undefined&&t!==undefined),"You should avoid providing a 2nd state argument to push when the 1st "+"argument is a location-like object that already has state; it is ignored");var n="PUSH";var o=w(e,t,B(f),Q.location);v.confirmTransitionTo(o,n,u,(function(e){if(!e){return}var t=L(o);var s=o.key,c=o.state;if(a){i.pushState({key:s,state:c},"",t);if(l){r.href=t}else{var u=k.indexOf(Q.location.key);var f=k.slice(0,u===-1?0:u+1);f.push(o.key);k=f;b({action:n,location:o})}}else{$(c===undefined,"Browser history cannot push state in browsers that do not support HTML5 history");r.href=t}}))};var H=function(e,t){$(!(typeof e==="object"&&e.state!==undefined&&t!==undefined),"You should avoid providing a 2nd state argument to replace when the 1st "+"argument is a location-like object that already has state; it is ignored");var n="REPLACE";var o=w(e,t,B(f),Q.location);v.confirmTransitionTo(o,n,u,(function(e){if(!e){return}var t=L(o);var s=o.key,c=o.state;if(a){i.replaceState({key:s,state:c},"",t);if(l){r.replace(t)}else{var u=k.indexOf(Q.location.key);if(u!==-1){k[u]=o.key}b({action:n,location:o})}}else{$(c===undefined,"Browser history cannot replace state in browsers that do not support HTML5 history");r.replace(t)}}))};var R=function(e){i.go(e)};var V=function(){return R(-1)};var N=function(){return R(1)};var q=function(t){P+=t;if(P===1){e.addEventListener(z,g);if(s){e.addEventListener(J,x)}}else if(P===0){e.removeEventListener(z,g);if(s){e.removeEventListener(J,x)}}};var W=function(e){if(e===void 0){e=""}var t=v.setPrompt(e);if(!A){q(1);A=true}return function(){if(A){A=false;q(-1)}return t()}};var Y=function(e){var t=v.appendListener(e);q(1);return function(){q(-1);t()}};var Q={length:i.length,action:"POP",location:O,createHref:L,push:M,replace:H,go:R,goBack:V,goForward:N,block:W,listen:Y,win:e};return Q};var G="hashchange";var X={hashbang:{encodePath:function(e){return e.charAt(0)==="!"?e:"!/"+x(e)},decodePath:function(e){return e.charAt(0)==="!"?e.substr(1):e}},noslash:{encodePath:x,decodePath:m},slash:{encodePath:m,decodePath:m}};var Z=function(e,t){if(t===void 0){t={}}var n=false;var i=null;var r=0;var o=false;var a=e.location;var s=e.history;var c=M(e.navigator);var l=t.keyLength!=null?t.keyLength:6;var u=t.getUserConfirmation,f=u===void 0?j:u,h=t.hashType,d=h===void 0?"slash":h;var p=t.basename?y(m(t.basename)):"";var v=X[d],b=v.encodePath,g=v.decodePath;var x=function(){var e=a.href;var t=e.indexOf("#");return t===-1?"":e.substring(t+1)};var D=function(e){return a.hash=e};var O=function(e){var t=a.href.indexOf("#");a.replace(a.href.slice(0,t>=0?t:0)+"#"+e)};var k=function(){var e=g(x());$(!p||C(e,p),"You are attempting to use a basename on a page whose URL path does not begin "+'with the basename. Expected path "'+e+'" to begin with "'+p+'".');if(p){e=_(e,p)}return w(e,undefined,B(l))};var P=F();var A=function(e){Object.assign(ee,e);ee.length=s.length;P.notifyListeners(ee.location,ee.action)};var L=function(){var e=x();var t=b(e);if(e!==t){O(t)}else{var r=k();var o=ee.location;if(!n&&S(o,r)){return}if(i===T(r)){return}i=null;E(r)}};var E=function(e){if(n){n=false;A()}else{var t="POP";P.confirmTransitionTo(e,t,f,(function(n){if(n){A({action:t,location:e})}else{I(e)}}))}};var I=function(e){var t=ee.location;var i=V.lastIndexOf(T(t));var r=V.lastIndexOf(T(e));if(i===-1){i=0}if(r===-1){r=0}var o=i-r;if(o){n=true;Y(o)}};var U=x();var H=b(U);if(U!==H){O(H)}var R=k();var V=[T(R)];var N=function(e){return"#"+b(p+T(e))};var q=function(e,t){$(t===undefined,"Hash history cannot push state; it is ignored");var n="PUSH";var r=w(e,undefined,B(l),ee.location);P.confirmTransitionTo(r,n,f,(function(e){if(!e){return}var t=T(r);var o=b(p+t);var a=x()!==o;if(a){i=t;D(o);var s=V.lastIndexOf(T(ee.location));var c=V.slice(0,s===-1?0:s+1);c.push(t);V=c;A({action:n,location:r})}else{$(false,"Hash history cannot PUSH the same path; a new entry will not be added to the history stack");A()}}))};var W=function(e,t){$(t===undefined,"Hash history cannot replace state; it is ignored");var n="REPLACE";var r=w(e,undefined,B(l),ee.location);P.confirmTransitionTo(r,n,f,(function(e){if(!e){return}var t=T(r);var o=b(p+t);var a=x()!==o;if(a){i=t;O(o)}var s=V.indexOf(T(ee.location));if(s!==-1){V[s]=t}A({action:n,location:r})}))};var Y=function(e){$(c,"Hash history go(n) causes a full page reload in this browser");s.go(e)};var K=function(){return Y(-1)};var z=function(){return Y(1)};var J=function(e,t){r+=t;if(r===1){e.addEventListener(G,L)}else if(r===0){e.removeEventListener(G,L)}};var Q=function(t){if(t===void 0){t=""}var n=P.setPrompt(t);if(!o){J(e,1);o=true}return function(){if(o){o=false;J(e,-1)}return n()}};var Z=function(t){var n=P.appendListener(t);J(e,1);return function(){J(e,-1);n()}};var ee={length:s.length,action:"POP",location:R,createHref:N,push:q,replace:W,go:Y,goBack:K,goForward:z,block:Q,listen:Z,win:e};return ee};var ee=function(e,t){var n=e.pathname.indexOf(t)==0?"/"+e.pathname.slice(t.length):e.pathname;return Object.assign({},e,{pathname:n})};var te={browser:Q,hash:Z};var ne=e("stencil_router",function(){function e(e){var n=this;t(this,e);this.root="/";this.historyType="browser";this.titleSuffix="";this.routeViewsUpdated=function(e){if(e===void 0){e={}}if(n.history&&e.scrollToId&&n.historyType==="browser"){var t=n.history.win.document.getElementById(e.scrollToId);if(t){return t.scrollIntoView()}}n.scrollTo(e.scrollTopOffset||n.scrollTopOffset)};this.isServer=o(this,"isServer");this.queue=o(this,"queue")}e.prototype.componentWillLoad=function(){var e=this;this.history=te[this.historyType](this.el.ownerDocument.defaultView);this.history.listen((function(t){t=ee(t,e.root);e.location=t}));this.location=ee(this.history.location,this.root)};e.prototype.scrollTo=function(e){var t=this.history;if(e==null||this.isServer||!t){return}if(t.action==="POP"&&Array.isArray(t.location.scrollPosition)){return this.queue.write((function(){if(t&&t.location&&Array.isArray(t.location.scrollPosition)){t.win.scrollTo(t.location.scrollPosition[0],t.location.scrollPosition[1])}}))}return this.queue.write((function(){t.win.scrollTo(0,e)}))};e.prototype.render=function(){if(!this.location||!this.history){return}var e={historyType:this.historyType,location:this.location,titleSuffix:this.titleSuffix,root:this.root,history:this.history,routeViewsUpdated:this.routeViewsUpdated};return n(O.Provider,{state:e},n("slot",null))};Object.defineProperty(e.prototype,"el",{get:function(){return r(this)},enumerable:false,configurable:true});return e}())}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{B as e}from"./p-
|
|
1
|
+
import{B as e}from"./p-7062880e.js";const t=new class{async postTrackEventAsync(t){return e.instance.url("benefits/track-event").post(t).res()}},n=new class{async trackAppLoadedAsync(){return this.trackEventAsync("appLoaded")}async trackPageViewedAsync(e){return this.trackEventAsync({pageViewed:e})}async trackBenefitLinkClickedAsync({benefitId:e,benefit:t}){return this.trackEventAsync({benefitSelected:{benefitId:e,attachment:"link",category:t.category,subtitle:t.subtitle,title:t.title}})}async trackBenefitAttachmentClickedAsync({benefitId:e,benefit:t}){return this.trackEventAsync({benefitSelected:{benefitId:e,attachment:"document",category:t.category,subtitle:t.subtitle,title:t.title}})}async trackEventAsync(e){try{await t.postTrackEventAsync({event:e})}catch(e){return}}};export{n as b}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,h as s}from"./p-91e1cdd0.js";import{b as e}from"./p-
|
|
1
|
+
import{r as t,h as s}from"./p-91e1cdd0.js";import{b as e}from"./p-d14b00d9.js";import"./p-7062880e.js";import"./p-2c9dd7c4.js";import"./p-7ad92407.js";import"./p-f3effa5d.js";import"./p-ea120e31.js";import"./p-054d1471.js";import"./p-f63d9d89.js";const i=class{constructor(s){t(this,s),this.onBenefitButtonClick=async t=>{t.preventDefault(),null!==this.benefit.url&&(window.open(this.benefit.url,"_blank"),e.trackBenefitLinkClickedAsync(this.benefitWithId))}}render(){return s("div",{class:"row h-100 d-flex justify-content-between no-gutters",onClick:async t=>this.onBenefitButtonClick(t)},s("div",{class:"col-9 col-md-12 col-lg-10 text-left"},s("h5",{class:"card-title mb-1"},this.benefit.title),s("h6",{class:"benefit-value-description"},this.benefit.subtitle),s("small",{class:"card-text text-muted text-uppercase"},this.benefit.description)),s("div",{class:"col-2 col-md-12 col-lg-2 d-flex justify-content-end align-items-center"},this.IconElement()))}get benefit(){return this.benefitWithId.benefit}IconElement(){var t;return null!==this.benefit.icon?s("img",{class:"img-fluid",src:null===(t=this.benefit.icon)||void 0===t?void 0:t.downloadUrl,alt:""}):s("ap-ben-icon",{class:"text-black-50 fa-3x",iconPrefix:"fad",iconId:"award"})}};i.style="ap-ben-benefit-card .fl-card-logo.img-fluid{height:1.25rem}";export{i as ap_ben_benefit_card}
|
|
@@ -12,4 +12,4 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
|
12
12
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
13
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
14
|
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
-
***************************************************************************** */function L(t,e,s,i){var n,r=arguments.length,h=r<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,s,i);else for(var c=t.length-1;c>=0;c--)(n=t[c])&&(h=(r<3?n(h):r>3?n(e,s,h):n(e,s))||h);return r>3&&h&&Object.defineProperty(e,s,h),h}function K(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}const D={type:null,entityIds:null,skip:!1,payload:null};let $=!1;function z(t,e,s){W(t,e,s),$=!0}function W(t,e,s){!1===$&&(D.type=t,D.entityIds=e,D.payload=s)}function B(t,e){return t.hasOwnProperty(e)}function V(t){return Array.isArray(t)}function H(t){return t.hasOwnProperty("active")}function Q(t){return V(t)}function J({active:t,ids:e,entities:s}){return Q(t)?function(t,e){const s=t.filter((t=>e.indexOf(t)>-1));return s.length===t.length?t:s}(t,e):!1===B(s,t)?null:t}function Y(t){return null==t}function q(t){return Y(t)?[]:Array.isArray(t)?t:[t]}function G(t){return"function"==typeof t}function X(t){return!!V(t)&&0===t.length}function Z(t){const e=typeof t;return null!=t&&("object"==e||"function"==e)}let tt={resettable:!1,ttl:null,producerFn:void 0};function et(){return tt}function st(t){return!1===Y(t)}const it=new E,nt=new N(50,5e3),rt=new E,ht="undefined"!=typeof window,ct=!ht,ot=()=>{try{return"undefined"!=typeof localStorage}catch(t){return!1}},ut={},at={};var lt,ft;ht&&(window.$$stores=ut,window.$$queries=at),function(t){t.ASC="asc",t.DESC="desc"}(lt||(lt={})),function(t){t.Set="Set",t.Add="Add",t.Update="Update",t.Remove="Remove"}(ft||(ft={}));let dt=!0;function pt(){dt=!1,ht&&(delete window.$$stores,delete window.$$queries)}function bt(){return dt}function gt(t){return void 0===t}function Ot(t,e){let s={};for(const i of Object.keys(t))s[i]=e(t[i]);return s}function jt(t){Object.freeze(t);const e="function"==typeof t,s=Object.prototype.hasOwnProperty;return Object.getOwnPropertyNames(t).forEach((function(i){!s.call(t,i)||e&&("caller"===i||"callee"===i||"arguments"===i)||null===t[i]||"object"!=typeof t[i]&&"function"!=typeof t[i]||Object.isFrozen(t[i])||jt(t[i])})),t}function yt(t){return null!=t&&"false"!=`${t}`}function wt(t){return yt(t)&&"Object"===t.constructor.name}function vt(t){return function(e){e.akitaConfig={idKey:"id"};for(let s=0,i=Object.keys(t);s<i.length;s++){const n=i[s];"name"===n?e.akitaConfig.storeName=t[n]:e.akitaConfig[n]=t[n]}}}const St=new E,Et=new I(!1),mt={activeTransactions:0,batchTransaction:null};function Tt(){return mt.activeTransactions>0}function At(t,e){Tt()||(mt.batchTransaction=new E),mt.activeTransactions++,Et.next(!0);try{return t.apply(e)}finally{z("@Transaction"),0==--mt.activeTransactions&&(mt.batchTransaction.next(!0),mt.batchTransaction.complete(),Et.next(!1),St.next(!0))}}function Pt(){return function(t,e,s){const i=s.value;return s.value=function(...t){return At((()=>i.apply(this,t)),this)},s}}class It{constructor(t,e={}){this.options=e,this.inTransaction=!1,this.cache={active:new I(!1),ttl:null},this.onInit(t)}setLoading(t=!1){t!==this._value().loading&&(bt()&&W("Set Loading"),this._setState((e=>Object.assign(Object.assign({},e),{loading:t}))))}setHasCache(t,e={restartTTL:!1}){if(t!==this.cache.active.value&&this.cache.active.next(t),e.restartTTL){const t=this.getCacheTTL();t&&(null!==this.cache.ttl&&clearTimeout(this.cache.ttl),this.cache.ttl=setTimeout((()=>this.setHasCache(!1)),t))}}getValue(){return this.storeValue}setError(t){t!==this._value().error&&(bt()&&W("Set Error"),this._setState((e=>Object.assign(Object.assign({},e),{error:t}))))}_select(t){return this.store.asObservable().pipe(p((e=>t(e.state))),b())}_value(){return this.storeValue}_cache(){return this.cache.active}get config(){return this.constructor.akitaConfig||{}}get storeName(){return this.config.storeName||this.options.storeName||this.options.name}get deepFreeze(){return this.config.deepFreezeFn||this.options.deepFreezeFn||jt}get cacheConfig(){return this.config.cache||this.options.cache}get _producerFn(){return this.config.producerFn||this.options.producerFn||tt.producerFn}get resettable(){return st(this.config.resettable)?this.config.resettable:this.options.resettable}_setState(t,e=!0){if(G(t)){const e=t(this._value());this.storeValue=dt?this.deepFreeze(e):e}else this.storeValue=t;if(!this.store)return this.store=new I({state:this.storeValue}),void(bt()&&this.store.subscribe((({action:t})=>{t&&function(t,e){rt.next({storeName:t,action:e})}(this.storeName,t)})));Tt()?this.handleTransaction():this.dispatch(this.storeValue,e)}reset(){this.isResettable()?(bt()&&W("Reset"),this._setState((()=>Object.assign({},this._initialState))),this.setHasCache(!1)):bt()&&console.warn("You need to enable the reset functionality")}update(t){let e;bt()&&W("Update");const s=this._value();e=G(t)?G(this._producerFn)?this._producerFn(s,t):t(s):t;const i=this.akitaPreUpdate(s,Object.assign(Object.assign({},s),e)),n=wt(s)?i:new s.constructor(i);this._setState(n)}updateStoreConfig(t){this.options=Object.assign(Object.assign({},this.options),t)}akitaPreUpdate(t,e){return e}ngOnDestroy(){this.destroy()}destroy(){ht&&window.hmrEnabled||this!==ut[this.storeName]||(delete ut[this.storeName],it.next(this.storeName),this.setHasCache(!1),this.cache.active.complete(),this.store.complete())}onInit(t){ut[this.storeName]=this,this._setState((()=>t)),nt.next(this.storeName),this.isResettable()&&(this._initialState=t),bt()&&(this.storeName||console.error(`@StoreConfig({ name }) is missing in ${this.constructor.name}`))}dispatch(t,e=!0){let s;e&&(s=D,$=!1),this.store.next({state:t,action:s})}watchTransaction(){(mt.batchTransaction?mt.batchTransaction.asObservable():o(!0)).subscribe((()=>{this.inTransaction=!1,this.dispatch(this._value())}))}isResettable(){return!1!==this.resettable&&(this.resettable||et().resettable)}handleTransaction(){this.inTransaction||(this.watchTransaction(),this.inTransaction=!0)}getCacheTTL(){return this.cacheConfig&&this.cacheConfig.ttl||et().ttl}}var Ut;class Nt extends It{constructor(t={},e={}){super(Object.assign(Object.assign({},{entities:{},ids:[],loading:!0,error:null}),t),e),this.options=e,this.entityActions=new E,this.entityIdChanges=new E}get selectEntityAction$(){return this.entityActions.asObservable()}get selectEntityIdChanges$(){return this.entityIdChanges.asObservable()}get idKey(){return this.config.idKey||this.options.idKey||"id"}set(t,e={}){if(Y(t))return;bt()&&W("Set Entity");const s=this.akitaPreAddEntity===Nt.prototype.akitaPreAddEntity;this.setHasCache(!0,{restartTTL:!0}),this._setState((i=>{const n=function({state:t,entities:e,idKey:s,preAddEntity:i,isNativePreAdd:n}){let r,h;if(V(e)){const t=function(t,e,s){const i={entities:{},ids:[]};for(const n of t){const t=s(n);i.entities[t[e]]=t,i.ids.push(t[e])}return i}(e,s,i);r=t.entities,h=t.ids}else!function(t){return t.entities&&t.ids}(e)?(r=n?e:Ot(e,i),h=Object.keys(r).map((t=>isNaN(t)?t:Number(t)))):(r=n?e.entities:Ot(e.entities,i),h=e.ids);const c=Object.assign(Object.assign({},t),{entities:r,ids:h,loading:!1});return H(t)&&(c.active=J(c)),c}({state:i,entities:t,idKey:this.idKey,preAddEntity:this.akitaPreAddEntity,isNativePreAdd:s});return!1===gt(e.activeId)&&(n.active=e.activeId),n})),this.hasInitialUIState()&&this.handleUICreation(),this.entityActions.next({type:ft.Set,ids:this.ids})}add(t,e={loading:!1}){const s=q(t);if(X(s))return;const i=function({state:t,entities:e,idKey:s,options:i={},preAddEntity:n}){let r={},h=[],c=!1;for(const o of e)if(!1===B(t.entities,o[s])){const t=n(o),e=t[s];r[e]=t,i.prepend?h.unshift(e):h.push(e),c=!0}return c?{newState:Object.assign(Object.assign({},t),{entities:Object.assign(Object.assign({},t.entities),r),ids:i.prepend?[...h,...t.ids]:[...t.ids,...h]}),newIds:h}:null}({state:this._value(),preAddEntity:this.akitaPreAddEntity,entities:s,idKey:this.idKey,options:e});i&&(bt()&&W("Add Entity"),i.newState.loading=e.loading,this._setState((()=>i.newState)),this.hasInitialUIState()&&this.handleUICreation(!0),this.entityActions.next({type:ft.Add,ids:i.newIds}))}update(t,e){if(gt(e))return void super.update(t);let s,i=[];i=G(t)?this.ids.filter((e=>t(this.entities[e]))):Y(t)?this.ids:q(t),X(i)||(bt()&&W("Update Entity",i),this._setState((t=>function({state:t,ids:e,idKey:s,newStateOrFn:i,preUpdateEntity:n,producerFn:r,onEntityIdChanges:h}){const c={};let o,u=!1;for(const h of e){if(!1===B(t.entities,h))continue;const e=t.entities[h];let a;a=G(i)?G(r)?r(e,i):i(e):i;const l=a.hasOwnProperty(s)&&a[s]!==e[s];let f;o=h,l&&(u=!0,o=a[s]);const d=Object.assign(Object.assign({},e),a);f=wt(e)?d:wt(a)?new e.constructor(d):new a.constructor(d),c[o]=n(e,f)}let a=t.ids,l=t.entities;if(u){const[s]=e,i=s;l=function(t,e){var s={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(s[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(s[i[n]]=t[i[n]])}return s}(t.entities,["symbol"==typeof i?i:i+""]),a=t.ids.map((t=>t===s?o:t)),h(s,o)}return Object.assign(Object.assign({},t),{entities:Object.assign(Object.assign({},l),c),ids:a})}({idKey:this.idKey,ids:i,preUpdateEntity:this.akitaPreUpdateEntity,state:t,newStateOrFn:e,producerFn:this._producerFn,onEntityIdChanges:(t,e)=>{s={oldId:t,newId:e},this.entityIdChanges.next(Object.assign(Object.assign({},s),{pending:!0}))}}))),s&&this.entityIdChanges.next(Object.assign(Object.assign({},s),{pending:!1})),this.entityActions.next({type:ft.Update,ids:i}))}upsert(t,e,s,i={}){const n=q(t),r=t=>e=>B(this.entities,e)===t,h=G(s)?i.baseClass:s?s.baseClass:void 0,c=G(h),o=n.filter(r(!0)),u=n.filter(r(!1)).map((t=>{const i="function"==typeof e?e({}):e,n=G(s)?s(t,i):i,r=Object.assign(Object.assign({},n),{[this.idKey]:t});return c?new h(r):r}));this.update(o,e),this.add(u),bt()&&z("Upsert Entity")}upsertMany(t,e={}){const s=[],i=[],n={};for(const r of t){const t=this.akitaPreCheckEntity(r),h=t[this.idKey];if(B(this.entities,h)){const s=this._value().entities[h],r=Object.assign(Object.assign({},this._value().entities[h]),t),c=e.baseClass?new e.baseClass(r):r,o=this.akitaPreUpdateEntity(s,c),u=o[this.idKey];n[u]=o,i.push(u)}else{const i=e.baseClass?new e.baseClass(t):t,r=this.akitaPreAddEntity(i),h=r[this.idKey];s.push(h),n[h]=r}}bt()&&z("Upsert Many"),this._setState((t=>Object.assign(Object.assign({},t),{ids:s.length?[...t.ids,...s]:t.ids,entities:Object.assign(Object.assign({},t.entities),n),loading:!!e.loading}))),i.length&&this.entityActions.next({type:ft.Update,ids:i}),s.length&&this.entityActions.next({type:ft.Add,ids:s}),s.length&&this.hasUIStore()&&this.handleUICreation(!0)}replace(t,e){const s=q(t);if(X(s))return;const i={};for(const t of s)i[t]=Object.assign(Object.assign({},e),{[this.idKey]:t});bt()&&W("Replace Entity",t),this._setState((t=>Object.assign(Object.assign({},t),{entities:Object.assign(Object.assign({},t.entities),i)})))}move(t,e){const s=this.ids.slice();s.splice(e<0?s.length+e:e,0,s.splice(t,1)[0]),bt()&&W("Move Entity"),this._setState((t=>Object.assign(Object.assign({},t),{entities:Object.assign({},t.entities),ids:s})))}remove(t){if(X(this.ids))return;const e=st(t);let s=[];s=G(t)?this.ids.filter((e=>t(this.entities[e]))):e?q(t):this.ids,X(s)||(bt()&&W("Remove Entity",s),this._setState((t=>function({state:t,ids:e}){if(Y(e))return function(t){return Object.assign(Object.assign({},t),{entities:{},ids:[],active:Q(t.active)?[]:null})}(t);const s=t.entities;let i={};for(const n of t.ids)!1===e.includes(n)&&(i[n]=s[n]);const n=Object.assign(Object.assign({},t),{entities:i,ids:t.ids.filter((t=>!1===e.includes(t)))});return H(t)&&(n.active=J(n)),n}({state:t,ids:s}))),e||this.setHasCache(!1),this.handleUIRemove(s),this.entityActions.next({type:ft.Remove,ids:s}))}updateActive(t){const e=q(this.active);bt()&&W("Update Active",e),this.update(e,t)}setActive(t){const e=function(t,e,s){let i;if(V(t))i=t;else if(Z(t)){if(Y(s))return;t=Object.assign({wrap:!0},t);const n=e.indexOf(s);if(t.prev){const s=0===n;if(s&&!t.wrap)return;i=s?e[e.length-1]:e[n-1]}else if(t.next){const s=e.length===n+1;if(s&&!t.wrap)return;i=s?e[0]:e[n+1]}}else{if(t===s)return;i=t}return i}(t,this.ids,this.active);void 0!==e&&(bt()&&W("Set Active",e),this._setActive(e))}addActive(t){const e=q(t);X(e)||e.every((t=>this.active.indexOf(t)>-1))||(bt()&&W("Add Active",t),this._setState((t=>{const s=Array.from(new Set([...t.active,...e]));return Object.assign(Object.assign({},t),{active:s})})))}removeActive(t){const e=q(t);X(e)||e.some((t=>this.active.indexOf(t)>-1))&&(bt()&&W("Remove Active",t),this._setState((t=>Object.assign(Object.assign({},t),{active:Array.isArray(t.active)?t.active.filter((t=>-1===e.indexOf(t))):null}))))}toggleActive(t){const e=q(t),s=t=>e=>this.active.includes(e)===t,i=e.filter(s(!0)),n=e.filter(s(!1));this.removeActive(i),this.addActive(n),bt()&&z("Toggle Active")}createUIStore(t={},e={}){return this.ui=new _t(t,Object.assign(Object.assign({},{name:`UI/${this.storeName}`,idKey:this.idKey}),e)),this.ui}destroy(){super.destroy(),this.ui instanceof Nt&&this.ui.destroy(),this.entityActions.complete()}akitaPreUpdateEntity(t,e){return e}akitaPreAddEntity(t){return t}akitaPreCheckEntity(t){return t}get ids(){return this._value().ids}get entities(){return this._value().entities}get active(){return this._value().active}_setActive(t){this._setState((e=>Object.assign(Object.assign({},e),{active:t})))}handleUICreation(t=!1){const e=this.ids,s=G(this.ui._akitaCreateEntityFn);let i;const n=t=>{const e=this.entities[t],i=s?this.ui._akitaCreateEntityFn(e):this.ui._akitaCreateEntityFn;return Object.assign({[this.idKey]:e[this.idKey]},i)};i=t?this.ids.filter((t=>gt(this.ui.entities[t]))).map(n):e.map(n),t?this.ui.add(i):this.ui.set(i)}hasInitialUIState(){return this.hasUIStore()&&!1===gt(this.ui._akitaCreateEntityFn)}handleUIRemove(t){this.hasUIStore()&&this.ui.remove(t)}hasUIStore(){return this.ui instanceof _t}}L([Pt(),K("design:type",Function),K("design:paramtypes",[Object,Object,Object,Object]),K("design:returntype",void 0)],Nt.prototype,"upsert",null),L([Pt(),K("design:type",Function),K("design:paramtypes",["function"==typeof(Ut="undefined"!=typeof T&&T)?Ut:Object]),K("design:returntype",void 0)],Nt.prototype,"toggleActive",null);class _t extends Nt{constructor(t={},e={}){super(t,e)}setInitialEntityState(t){this._akitaCreateEntityFn=t}}class xt{constructor(t){this.store=t,this.__store__=t,bt()&&(at[t.storeName]=this)}select(t){let e;if(G(t))e=t;else if("string"==typeof t)e=e=>e[t];else{if(Array.isArray(t))return this.store._select((t=>t)).pipe(b((s=t,function(t,e){const i=G(s[0]);return!1===s.some((s=>i?s(t)!==s(e):t[s]!==e[s]))})),p((e=>G(t[0])?t.map((t=>t(e))):t.reduce(((t,s)=>(t[s]=e[s],t)),{}))));e=t=>t}var s;return this.store._select(e)}selectLoading(){return this.select((t=>t.loading))}selectError(){return this.select((t=>t.error))}getValue(){return this.store._value()}selectHasCache(){return this.store._cache().asObservable()}getHasCache(){return this.store._cache().value}get config(){return this.constructor.akitaQueryConfig}}function Ct(t,e){return 1===e.split(".").length?t:e.split(".").slice(1).join(".").split(".").reduce(((t,e)=>t&&t[e]),t)}function Rt(t,e,s,i=!1){const n=e.split(".");if(1===n.length)return Object.assign(Object.assign({},t),s);t=Object.assign({},t);const r=n.length-2;return e.split(".").slice(1).reduce(((t,e,n)=>n!==r?(t[e]=Object.assign({},t[e]),t&&t[e]):(t[e]=i||Array.isArray(t[e])||!Z(t[e])?s:Object.assign(Object.assign({},t[e]),s),t&&t[e])),t),t}const Ft=new N(1);function Mt(){return!1}function kt(t){return(e=t)&&G(e.then)||k(t)?d(t):o(t);var e}function Lt(t){const e={key:"AkitaStores",enableInNonBrowser:!1,storage:ot()?localStorage:t.storage,deserialize:JSON.parse,serialize:JSON.stringify,include:[],select:[],persistOnDestroy:!1,preStorageUpdate:function(t,e){return e},preStoreUpdate:function(t,e){return e},skipStorageUpdate:Mt,preStorageUpdateOperator:()=>t=>t},{storage:s,enableInNonBrowser:i,deserialize:n,serialize:r,include:h,select:c,key:o,preStorageUpdate:u,persistOnDestroy:a,preStorageUpdateOperator:l,preStoreUpdate:f,skipStorageUpdate:d}=Object.assign({},e,t);if(ct&&!i||!s)return;const b=h.length>0,O=c.length>0;let j,y;b&&(j=h.reduce(((t,e)=>(G(e)?t.fns.push(e):t[e.split(".")[0]]=e,t)),{fns:[]})),O&&(y=c.reduce(((t,e)=>(t[e.storeName]=e,t)),{}));let w={},v={},S=[];const E=[];function m(t){kt(t).subscribe((()=>{const t=E.shift();t&&m(t)}))}const T=ot()&&s===localStorage||(()=>{try{return"undefined"!=typeof sessionStorage}catch(t){return!1}})()&&s===sessionStorage;return kt(s.getItem(o)).subscribe((t=>{let e=Z(t)?t:n(t||"{}");function i(t){e.$cache=Object.assign(Object.assign({},e.$cache||{}),t),e=Object.assign({},e,v),E.push(s.setItem(o,T?r(e):e)),m(E.shift())}function h(t,e){w[t]=ut[t]._select((t=>Ct(t,e))).pipe((1,t=>t.lift(new x(1))),p((e=>O&&y[t]?y[t](e):e)),g((()=>!1===d())),l()).subscribe((e=>{v[t]=u(t,e),Promise.resolve().then((()=>i({[t]:ut[t]._cache().getValue()})))}))}function c(t,s,i){t in e&&(W("@PersistState"),s._setState((s=>Rt(s,i,f(t,e[t],s)))),ut[t].setHasCache(!!e.$cache&&e.$cache[t],{restartTTL:!0}))}S.push(it.subscribe((t=>{w[t]&&(!1===a&&i({[t]:!1}),w[t].unsubscribe(),delete w[t])}))),S.push(nt.subscribe((t=>{if("router"===t)return;const e=ut[t];if(b){let s=j[t];if(!s){if(!j.fns.some((e=>e(t))))return;s=t}c(t,e,s),h(t,s)}else c(t,e,t),h(t,t)}))),Ft.next()})),{destroy(){S.forEach((t=>t.unsubscribe()));for(let t=0,e=Object.keys(w);t<e.length;t++)w[e[t]].unsubscribe();w={}},clear(){s.clear()},clearStore(t){Y(t)?kt(s.setItem(o,"{}")).subscribe():kt(s.getItem(o)).subscribe((e=>{const i=n(e||"{}");i[t]&&(delete i[t],kt(s.setItem(o,r(i))).subscribe())}))}}}const Kt={pagesControls:!1,range:!1,startWith:1,cacheTimeout:void 0,clearStoreWithCache:!0};var Dt,$t;L([function(t,e,s){const i=s.value;return s.value=function(...t){return z("@Pagination - New Page",void 0),i.apply(this,t)},s},K("design:type",Function),K("design:paramtypes",[Object]),K("design:returntype",void 0)],class extends class{constructor(t,e){this.query=t,e&&e.resetFn&&et().resettable&&this.onReset(e.resetFn)}getQuery(){return this.query}getStore(){return this.getQuery().__store__}isEntityBased(t){return yt(t)}selectSource(t,e){return this.isEntityBased(t)?this.getQuery().selectEntity(t).pipe(g((t=>null!=t))):e?this.getQuery().select((t=>Ct(t,this.withStoreName(e)))):this.getQuery().select()}getSource(t,e){if(this.isEntityBased(t))return this.getQuery().getEntity(t);const s=this.getQuery().getValue();return e?Ct(s,this.withStoreName(e)):s}withStoreName(t){return`${this.storeName}.${t}`}get storeName(){return this.getStore().storeName}updateStore(t,e,s,i=!1){if(this.isEntityBased(e)){const s=this.getStore();i?s.replace(e,t):s.update(e,t)}else{if(s)return void this.getStore()._setState((e=>Rt(e,this.withStoreName(s),t,!0)));const e=i?t:e=>Object.assign(Object.assign({},e),t);this.getStore()._setState(e)}}onReset(t){const e=this.getStore().reset;this.getStore().reset=(...s)=>{setTimeout((()=>{e.apply(this.getStore(),s),t()}))}}}{constructor(t,e={}){super(t,{resetFn:()=>{this.initial=!1,this.destroy({clearCache:!0,currentPage:1})}}),this.query=t,this.config=e,this.metadata=new Map,this.pages=new Map,this.pagination={currentPage:1,perPage:0,total:0,lastPage:0,data:[]},this.initial=!0,this.isLoading$=this.query.selectLoading().pipe(u(0)),this.config=Object.assign(Object.assign({},Kt),e);const{startWith:s,cacheTimeout:i}=this.config;this.page=new I(s),k(i)&&(this.clearCacheSubscription=i.subscribe((()=>this.clearCache())))}get pageChanges(){return this.page.asObservable()}get currentPage(){return this.pagination.currentPage}get isFirst(){return 1===this.currentPage}get isLast(){return this.currentPage===this.pagination.lastPage}withControls(){return this.config.pagesControls=!0,this}withRange(){return this.config.range=!0,this}setLoading(t=!0){this.getStore().setLoading(t)}update(t){this.pagination=t,this.addPage(t.data)}addPage(t){this.pages.set(this.currentPage,{ids:t.map((t=>t[this.getStore().idKey]))}),this.getStore().upsertMany(t)}clearCache(t={}){this.initial||(z("@Pagination - Clear Cache"),!1!==t.clearStore&&(this.config.clearStoreWithCache||t.clearStore)&&this.getStore().remove(),this.pages=new Map,this.metadata=new Map),this.initial=!1}clearPage(t){this.pages.delete(t)}destroy({clearCache:t,currentPage:e}={}){this.clearCacheSubscription&&this.clearCacheSubscription.unsubscribe(),t&&this.clearCache(),gt(e)||this.setPage(e),this.initial=!0}isPageActive(t){return this.currentPage===t}setPage(t){t===this.currentPage&&this.hasPage(t)||this.page.next(this.pagination.currentPage=t)}nextPage(){this.currentPage!==this.pagination.lastPage&&this.setPage(this.pagination.currentPage+1)}prevPage(){this.pagination.currentPage>1&&this.setPage(this.pagination.currentPage-1)}setLastPage(){this.setPage(this.pagination.lastPage)}setFirstPage(){this.setPage(1)}hasPage(t){return this.pages.has(t)}getPage(t){let e=this.pagination.currentPage;return this.hasPage(e)?this.selectPage(e):(this.setLoading(!0),d(t()).pipe(R((t=>(e=t.currentPage,At((()=>{this.setLoading(!1),this.update(t)})),this.selectPage(e))))))}getQuery(){return this.query}refreshCurrentPage(){!1===Y(this.currentPage)&&(this.clearPage(this.currentPage),this.setPage(this.currentPage))}getFrom(){return this.isFirst?1:(this.currentPage-1)*this.pagination.perPage+1}getTo(){return this.isLast?this.pagination.total:this.currentPage*this.pagination.perPage}selectPage(t){return this.query.selectAll({asObject:!0}).pipe((1,t=>t.lift(new j(1))),p((e=>{const s=Object.assign(Object.assign({},this.pagination),{data:this.pages.get(t).ids.map((t=>e[t]))}),{range:i,pagesControls:n}=this.config;return isNaN(this.pagination.total)&&(s.total=1===s.lastPage?s.data?s.data.length:0:s.perPage*s.lastPage,this.pagination.total=s.total),i&&(s.from=this.getFrom(),s.to=this.getTo()),n&&(s.pageControls=function(t,e){const s=Math.ceil(t/e),i=[];for(let t=0;t<s;t++)i.push(t+1);return i}(this.pagination.total,this.pagination.perPage)),s})))}}.prototype,"update",null),function(t){t.Update="UPDATE"}(Dt||(Dt={})),function(t){t.Update="UPDATE",t.AddEntities="ADD_ENTITIES",t.SetEntities="SET_ENTITIES",t.UpdateEntities="UPDATE_ENTITIES",t.RemoveEntities="REMOVE_ENTITIES",t.UpsertEntities="UPSERT_ENTITIES",t.UpsertManyEntities="UPSERT_MANY_ENTITIES"}($t||($t={}));export{xt as Q,vt as S,It as a,pt as e,Lt as p}
|
|
15
|
+
***************************************************************************** */function L(t,e,s,i){var n,r=arguments.length,h=r<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,s,i);else for(var c=t.length-1;c>=0;c--)(n=t[c])&&(h=(r<3?n(h):r>3?n(e,s,h):n(e,s))||h);return r>3&&h&&Object.defineProperty(e,s,h),h}function K(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}const D={type:null,entityIds:null,skip:!1,payload:null};let $=!1;function z(t,e,s){W(t,e,s),$=!0}function W(t,e,s){!1===$&&(D.type=t,D.entityIds=e,D.payload=s)}function B(t,e){return t.hasOwnProperty(e)}function V(t){return Array.isArray(t)}function H(t){return t.hasOwnProperty("active")}function Q(t){return V(t)}function J({active:t,ids:e,entities:s}){return Q(t)?function(t,e){const s=t.filter((t=>e.indexOf(t)>-1));return s.length===t.length?t:s}(t,e):!1===B(s,t)?null:t}function Y(t){return null==t}function q(t){return Y(t)?[]:Array.isArray(t)?t:[t]}function G(t){return!!V(t)&&0===t.length}function X(t){return"function"==typeof t}function Z(t){const e=typeof t;return null!=t&&("object"==e||"function"==e)}let tt={resettable:!1,ttl:null,producerFn:void 0};function et(){return tt}function st(t){return!1===Y(t)}const it=new E,nt=new N(50,5e3),rt=new E,ht="undefined"!=typeof window,ct=!ht,ot=()=>{try{return"undefined"!=typeof localStorage}catch(t){return!1}},ut={},at={};var lt,ft;ht&&(window.$$stores=ut,window.$$queries=at),function(t){t.ASC="asc",t.DESC="desc"}(lt||(lt={})),function(t){t.Set="Set",t.Add="Add",t.Update="Update",t.Remove="Remove"}(ft||(ft={}));let dt=!0;function pt(){dt=!1,ht&&(delete window.$$stores,delete window.$$queries)}function bt(){return dt}function gt(t){return void 0===t}function Ot(t,e){let s={};for(const i of Object.keys(t))s[i]=e(t[i]);return s}function jt(t){Object.freeze(t);const e="function"==typeof t,s=Object.prototype.hasOwnProperty;return Object.getOwnPropertyNames(t).forEach((function(i){!s.call(t,i)||e&&("caller"===i||"callee"===i||"arguments"===i)||null===t[i]||"object"!=typeof t[i]&&"function"!=typeof t[i]||Object.isFrozen(t[i])||jt(t[i])})),t}function yt(t){return null!=t&&"false"!=`${t}`}function wt(t){return yt(t)&&"Object"===t.constructor.name}function vt(t){return function(e){e.akitaConfig={idKey:"id"};for(let s=0,i=Object.keys(t);s<i.length;s++){const n=i[s];"name"===n?e.akitaConfig.storeName=t[n]:e.akitaConfig[n]=t[n]}}}const St=new E,Et=new I(!1),mt={activeTransactions:0,batchTransaction:null};function Tt(){return mt.activeTransactions>0}function At(t,e){Tt()||(mt.batchTransaction=new E),mt.activeTransactions++,Et.next(!0);try{return t.apply(e)}finally{z("@Transaction"),0==--mt.activeTransactions&&(mt.batchTransaction.next(!0),mt.batchTransaction.complete(),Et.next(!1),St.next(!0))}}function Pt(){return function(t,e,s){const i=s.value;return s.value=function(...t){return At((()=>i.apply(this,t)),this)},s}}class It{constructor(t,e={}){this.options=e,this.inTransaction=!1,this.cache={active:new I(!1),ttl:null},this.onInit(t)}setLoading(t=!1){t!==this._value().loading&&(bt()&&W("Set Loading"),this._setState((e=>Object.assign(Object.assign({},e),{loading:t}))))}setHasCache(t,e={restartTTL:!1}){if(t!==this.cache.active.value&&this.cache.active.next(t),e.restartTTL){const t=this.getCacheTTL();t&&(null!==this.cache.ttl&&clearTimeout(this.cache.ttl),this.cache.ttl=setTimeout((()=>this.setHasCache(!1)),t))}}getValue(){return this.storeValue}setError(t){t!==this._value().error&&(bt()&&W("Set Error"),this._setState((e=>Object.assign(Object.assign({},e),{error:t}))))}_select(t){return this.store.asObservable().pipe(p((e=>t(e.state))),b())}_value(){return this.storeValue}_cache(){return this.cache.active}get config(){return this.constructor.akitaConfig||{}}get storeName(){return this.config.storeName||this.options.storeName||this.options.name}get deepFreeze(){return this.config.deepFreezeFn||this.options.deepFreezeFn||jt}get cacheConfig(){return this.config.cache||this.options.cache}get _producerFn(){return this.config.producerFn||this.options.producerFn||tt.producerFn}get resettable(){return st(this.config.resettable)?this.config.resettable:this.options.resettable}_setState(t,e=!0){if(X(t)){const e=t(this._value());this.storeValue=dt?this.deepFreeze(e):e}else this.storeValue=t;if(!this.store)return this.store=new I({state:this.storeValue}),void(bt()&&this.store.subscribe((({action:t})=>{t&&function(t,e){rt.next({storeName:t,action:e})}(this.storeName,t)})));Tt()?this.handleTransaction():this.dispatch(this.storeValue,e)}reset(){this.isResettable()?(bt()&&W("Reset"),this._setState((()=>Object.assign({},this._initialState))),this.setHasCache(!1)):bt()&&console.warn("You need to enable the reset functionality")}update(t){let e;bt()&&W("Update");const s=this._value();e=X(t)?X(this._producerFn)?this._producerFn(s,t):t(s):t;const i=this.akitaPreUpdate(s,Object.assign(Object.assign({},s),e)),n=wt(s)?i:new s.constructor(i);this._setState(n)}updateStoreConfig(t){this.options=Object.assign(Object.assign({},this.options),t)}akitaPreUpdate(t,e){return e}ngOnDestroy(){this.destroy()}destroy(){ht&&window.hmrEnabled||this!==ut[this.storeName]||(delete ut[this.storeName],it.next(this.storeName),this.setHasCache(!1),this.cache.active.complete(),this.store.complete())}onInit(t){ut[this.storeName]=this,this._setState((()=>t)),nt.next(this.storeName),this.isResettable()&&(this._initialState=t),bt()&&(this.storeName||console.error(`@StoreConfig({ name }) is missing in ${this.constructor.name}`))}dispatch(t,e=!0){let s;e&&(s=D,$=!1),this.store.next({state:t,action:s})}watchTransaction(){(mt.batchTransaction?mt.batchTransaction.asObservable():o(!0)).subscribe((()=>{this.inTransaction=!1,this.dispatch(this._value())}))}isResettable(){return!1!==this.resettable&&(this.resettable||et().resettable)}handleTransaction(){this.inTransaction||(this.watchTransaction(),this.inTransaction=!0)}getCacheTTL(){return this.cacheConfig&&this.cacheConfig.ttl||et().ttl}}var Ut;class Nt extends It{constructor(t={},e={}){super(Object.assign(Object.assign({},{entities:{},ids:[],loading:!0,error:null}),t),e),this.options=e,this.entityActions=new E,this.entityIdChanges=new E}get selectEntityAction$(){return this.entityActions.asObservable()}get selectEntityIdChanges$(){return this.entityIdChanges.asObservable()}get idKey(){return this.config.idKey||this.options.idKey||"id"}set(t,e={}){if(Y(t))return;bt()&&W("Set Entity");const s=this.akitaPreAddEntity===Nt.prototype.akitaPreAddEntity;this.setHasCache(!0,{restartTTL:!0}),this._setState((i=>{const n=function({state:t,entities:e,idKey:s,preAddEntity:i,isNativePreAdd:n}){let r,h;if(V(e)){const t=function(t,e,s){const i={entities:{},ids:[]};for(const n of t){const t=s(n);i.entities[t[e]]=t,i.ids.push(t[e])}return i}(e,s,i);r=t.entities,h=t.ids}else!function(t){return t.entities&&t.ids}(e)?(r=n?e:Ot(e,i),h=Object.keys(r).map((t=>isNaN(t)?t:Number(t)))):(r=n?e.entities:Ot(e.entities,i),h=e.ids);const c=Object.assign(Object.assign({},t),{entities:r,ids:h,loading:!1});return H(t)&&(c.active=J(c)),c}({state:i,entities:t,idKey:this.idKey,preAddEntity:this.akitaPreAddEntity,isNativePreAdd:s});return!1===gt(e.activeId)&&(n.active=e.activeId),n})),this.hasInitialUIState()&&this.handleUICreation(),this.entityActions.next({type:ft.Set,ids:this.ids})}add(t,e={loading:!1}){const s=q(t);if(G(s))return;const i=function({state:t,entities:e,idKey:s,options:i={},preAddEntity:n}){let r={},h=[],c=!1;for(const o of e)if(!1===B(t.entities,o[s])){const t=n(o),e=t[s];r[e]=t,i.prepend?h.unshift(e):h.push(e),c=!0}return c?{newState:Object.assign(Object.assign({},t),{entities:Object.assign(Object.assign({},t.entities),r),ids:i.prepend?[...h,...t.ids]:[...t.ids,...h]}),newIds:h}:null}({state:this._value(),preAddEntity:this.akitaPreAddEntity,entities:s,idKey:this.idKey,options:e});i&&(bt()&&W("Add Entity"),i.newState.loading=e.loading,this._setState((()=>i.newState)),this.hasInitialUIState()&&this.handleUICreation(!0),this.entityActions.next({type:ft.Add,ids:i.newIds}))}update(t,e){if(gt(e))return void super.update(t);let s,i=[];i=X(t)?this.ids.filter((e=>t(this.entities[e]))):Y(t)?this.ids:q(t),G(i)||(bt()&&W("Update Entity",i),this._setState((t=>function({state:t,ids:e,idKey:s,newStateOrFn:i,preUpdateEntity:n,producerFn:r,onEntityIdChanges:h}){const c={};let o,u=!1;for(const h of e){if(!1===B(t.entities,h))continue;const e=t.entities[h];let a;a=X(i)?X(r)?r(e,i):i(e):i;const l=a.hasOwnProperty(s)&&a[s]!==e[s];let f;o=h,l&&(u=!0,o=a[s]);const d=Object.assign(Object.assign({},e),a);f=wt(e)?d:wt(a)?new e.constructor(d):new a.constructor(d),c[o]=n(e,f)}let a=t.ids,l=t.entities;if(u){const[s]=e,i=s;l=function(t,e){var s={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(s[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(s[i[n]]=t[i[n]])}return s}(t.entities,["symbol"==typeof i?i:i+""]),a=t.ids.map((t=>t===s?o:t)),h(s,o)}return Object.assign(Object.assign({},t),{entities:Object.assign(Object.assign({},l),c),ids:a})}({idKey:this.idKey,ids:i,preUpdateEntity:this.akitaPreUpdateEntity,state:t,newStateOrFn:e,producerFn:this._producerFn,onEntityIdChanges:(t,e)=>{s={oldId:t,newId:e},this.entityIdChanges.next(Object.assign(Object.assign({},s),{pending:!0}))}}))),s&&this.entityIdChanges.next(Object.assign(Object.assign({},s),{pending:!1})),this.entityActions.next({type:ft.Update,ids:i}))}upsert(t,e,s,i={}){const n=q(t),r=t=>e=>B(this.entities,e)===t,h=X(s)?i.baseClass:s?s.baseClass:void 0,c=X(h),o=n.filter(r(!0)),u=n.filter(r(!1)).map((t=>{const i="function"==typeof e?e({}):e,n=X(s)?s(t,i):i,r=Object.assign(Object.assign({},n),{[this.idKey]:t});return c?new h(r):r}));this.update(o,e),this.add(u),bt()&&z("Upsert Entity")}upsertMany(t,e={}){const s=[],i=[],n={};for(const r of t){const t=this.akitaPreCheckEntity(r),h=t[this.idKey];if(B(this.entities,h)){const s=this._value().entities[h],r=Object.assign(Object.assign({},this._value().entities[h]),t),c=e.baseClass?new e.baseClass(r):r,o=this.akitaPreUpdateEntity(s,c),u=o[this.idKey];n[u]=o,i.push(u)}else{const i=e.baseClass?new e.baseClass(t):t,r=this.akitaPreAddEntity(i),h=r[this.idKey];s.push(h),n[h]=r}}bt()&&z("Upsert Many"),this._setState((t=>Object.assign(Object.assign({},t),{ids:s.length?[...t.ids,...s]:t.ids,entities:Object.assign(Object.assign({},t.entities),n),loading:!!e.loading}))),i.length&&this.entityActions.next({type:ft.Update,ids:i}),s.length&&this.entityActions.next({type:ft.Add,ids:s}),s.length&&this.hasUIStore()&&this.handleUICreation(!0)}replace(t,e){const s=q(t);if(G(s))return;const i={};for(const t of s)i[t]=Object.assign(Object.assign({},e),{[this.idKey]:t});bt()&&W("Replace Entity",t),this._setState((t=>Object.assign(Object.assign({},t),{entities:Object.assign(Object.assign({},t.entities),i)})))}move(t,e){const s=this.ids.slice();s.splice(e<0?s.length+e:e,0,s.splice(t,1)[0]),bt()&&W("Move Entity"),this._setState((t=>Object.assign(Object.assign({},t),{entities:Object.assign({},t.entities),ids:s})))}remove(t){if(G(this.ids))return;const e=st(t);let s=[];s=X(t)?this.ids.filter((e=>t(this.entities[e]))):e?q(t):this.ids,G(s)||(bt()&&W("Remove Entity",s),this._setState((t=>function({state:t,ids:e}){if(Y(e))return function(t){return Object.assign(Object.assign({},t),{entities:{},ids:[],active:Q(t.active)?[]:null})}(t);const s=t.entities;let i={};for(const n of t.ids)!1===e.includes(n)&&(i[n]=s[n]);const n=Object.assign(Object.assign({},t),{entities:i,ids:t.ids.filter((t=>!1===e.includes(t)))});return H(t)&&(n.active=J(n)),n}({state:t,ids:s}))),e||this.setHasCache(!1),this.handleUIRemove(s),this.entityActions.next({type:ft.Remove,ids:s}))}updateActive(t){const e=q(this.active);bt()&&W("Update Active",e),this.update(e,t)}setActive(t){const e=function(t,e,s){let i;if(V(t))i=t;else if(Z(t)){if(Y(s))return;t=Object.assign({wrap:!0},t);const n=e.indexOf(s);if(t.prev){const s=0===n;if(s&&!t.wrap)return;i=s?e[e.length-1]:e[n-1]}else if(t.next){const s=e.length===n+1;if(s&&!t.wrap)return;i=s?e[0]:e[n+1]}}else{if(t===s)return;i=t}return i}(t,this.ids,this.active);void 0!==e&&(bt()&&W("Set Active",e),this._setActive(e))}addActive(t){const e=q(t);G(e)||e.every((t=>this.active.indexOf(t)>-1))||(bt()&&W("Add Active",t),this._setState((t=>{const s=Array.from(new Set([...t.active,...e]));return Object.assign(Object.assign({},t),{active:s})})))}removeActive(t){const e=q(t);G(e)||e.some((t=>this.active.indexOf(t)>-1))&&(bt()&&W("Remove Active",t),this._setState((t=>Object.assign(Object.assign({},t),{active:Array.isArray(t.active)?t.active.filter((t=>-1===e.indexOf(t))):null}))))}toggleActive(t){const e=q(t),s=t=>e=>this.active.includes(e)===t,i=e.filter(s(!0)),n=e.filter(s(!1));this.removeActive(i),this.addActive(n),bt()&&z("Toggle Active")}createUIStore(t={},e={}){return this.ui=new _t(t,Object.assign(Object.assign({},{name:`UI/${this.storeName}`,idKey:this.idKey}),e)),this.ui}destroy(){super.destroy(),this.ui instanceof Nt&&this.ui.destroy(),this.entityActions.complete()}akitaPreUpdateEntity(t,e){return e}akitaPreAddEntity(t){return t}akitaPreCheckEntity(t){return t}get ids(){return this._value().ids}get entities(){return this._value().entities}get active(){return this._value().active}_setActive(t){this._setState((e=>Object.assign(Object.assign({},e),{active:t})))}handleUICreation(t=!1){const e=this.ids,s=X(this.ui._akitaCreateEntityFn);let i;const n=t=>{const e=this.entities[t],i=s?this.ui._akitaCreateEntityFn(e):this.ui._akitaCreateEntityFn;return Object.assign({[this.idKey]:e[this.idKey]},i)};i=t?this.ids.filter((t=>gt(this.ui.entities[t]))).map(n):e.map(n),t?this.ui.add(i):this.ui.set(i)}hasInitialUIState(){return this.hasUIStore()&&!1===gt(this.ui._akitaCreateEntityFn)}handleUIRemove(t){this.hasUIStore()&&this.ui.remove(t)}hasUIStore(){return this.ui instanceof _t}}L([Pt(),K("design:type",Function),K("design:paramtypes",[Object,Object,Object,Object]),K("design:returntype",void 0)],Nt.prototype,"upsert",null),L([Pt(),K("design:type",Function),K("design:paramtypes",["function"==typeof(Ut="undefined"!=typeof T&&T)?Ut:Object]),K("design:returntype",void 0)],Nt.prototype,"toggleActive",null);class _t extends Nt{constructor(t={},e={}){super(t,e)}setInitialEntityState(t){this._akitaCreateEntityFn=t}}class xt{constructor(t){this.store=t,this.__store__=t,bt()&&(at[t.storeName]=this)}select(t){let e;if(X(t))e=t;else if("string"==typeof t)e=e=>e[t];else{if(Array.isArray(t))return this.store._select((t=>t)).pipe(b((s=t,function(t,e){const i=X(s[0]);return!1===s.some((s=>i?s(t)!==s(e):t[s]!==e[s]))})),p((e=>X(t[0])?t.map((t=>t(e))):t.reduce(((t,s)=>(t[s]=e[s],t)),{}))));e=t=>t}var s;return this.store._select(e)}selectLoading(){return this.select((t=>t.loading))}selectError(){return this.select((t=>t.error))}getValue(){return this.store._value()}selectHasCache(){return this.store._cache().asObservable()}getHasCache(){return this.store._cache().value}get config(){return this.constructor.akitaQueryConfig}}function Ct(t,e){return 1===e.split(".").length?t:e.split(".").slice(1).join(".").split(".").reduce(((t,e)=>t&&t[e]),t)}function Rt(t,e,s,i=!1){const n=e.split(".");if(1===n.length)return Object.assign(Object.assign({},t),s);t=Object.assign({},t);const r=n.length-2;return e.split(".").slice(1).reduce(((t,e,n)=>n!==r?(t[e]=Object.assign({},t[e]),t&&t[e]):(t[e]=i||Array.isArray(t[e])||!Z(t[e])?s:Object.assign(Object.assign({},t[e]),s),t&&t[e])),t),t}const Ft=new N(1);function Mt(){return!1}function kt(t){return(e=t)&&X(e.then)||k(t)?d(t):o(t);var e}function Lt(t){const e={key:"AkitaStores",enableInNonBrowser:!1,storage:ot()?localStorage:t.storage,deserialize:JSON.parse,serialize:JSON.stringify,include:[],select:[],persistOnDestroy:!1,preStorageUpdate:function(t,e){return e},preStoreUpdate:function(t,e){return e},skipStorageUpdate:Mt,preStorageUpdateOperator:()=>t=>t},{storage:s,enableInNonBrowser:i,deserialize:n,serialize:r,include:h,select:c,key:o,preStorageUpdate:u,persistOnDestroy:a,preStorageUpdateOperator:l,preStoreUpdate:f,skipStorageUpdate:d}=Object.assign({},e,t);if(ct&&!i||!s)return;const b=h.length>0,O=c.length>0;let j,y;b&&(j=h.reduce(((t,e)=>(X(e)?t.fns.push(e):t[e.split(".")[0]]=e,t)),{fns:[]})),O&&(y=c.reduce(((t,e)=>(t[e.storeName]=e,t)),{}));let w={},v={},S=[];const E=[];function m(t){kt(t).subscribe((()=>{const t=E.shift();t&&m(t)}))}const T=ot()&&s===localStorage||(()=>{try{return"undefined"!=typeof sessionStorage}catch(t){return!1}})()&&s===sessionStorage;return kt(s.getItem(o)).subscribe((t=>{let e=Z(t)?t:n(t||"{}");function i(t){e.$cache=Object.assign(Object.assign({},e.$cache||{}),t),e=Object.assign({},e,v),E.push(s.setItem(o,T?r(e):e)),m(E.shift())}function h(t,e){w[t]=ut[t]._select((t=>Ct(t,e))).pipe((1,t=>t.lift(new x(1))),p((e=>O&&y[t]?y[t](e):e)),g((()=>!1===d())),l()).subscribe((e=>{v[t]=u(t,e),Promise.resolve().then((()=>i({[t]:ut[t]._cache().getValue()})))}))}function c(t,s,i){t in e&&(W("@PersistState"),s._setState((s=>Rt(s,i,f(t,e[t],s)))),ut[t].setHasCache(!!e.$cache&&e.$cache[t],{restartTTL:!0}))}S.push(it.subscribe((t=>{w[t]&&(!1===a&&i({[t]:!1}),w[t].unsubscribe(),delete w[t])}))),S.push(nt.subscribe((t=>{if("router"===t)return;const e=ut[t];if(b){let s=j[t];if(!s){if(!j.fns.some((e=>e(t))))return;s=t}c(t,e,s),h(t,s)}else c(t,e,t),h(t,t)}))),Ft.next()})),{destroy(){S.forEach((t=>t.unsubscribe()));for(let t=0,e=Object.keys(w);t<e.length;t++)w[e[t]].unsubscribe();w={}},clear(){s.clear()},clearStore(t){Y(t)?kt(s.setItem(o,"{}")).subscribe():kt(s.getItem(o)).subscribe((e=>{const i=n(e||"{}");i[t]&&(delete i[t],kt(s.setItem(o,r(i))).subscribe())}))}}}const Kt={pagesControls:!1,range:!1,startWith:1,cacheTimeout:void 0,clearStoreWithCache:!0};var Dt,$t;L([function(t,e,s){const i=s.value;return s.value=function(...t){return z("@Pagination - New Page",void 0),i.apply(this,t)},s},K("design:type",Function),K("design:paramtypes",[Object]),K("design:returntype",void 0)],class extends class{constructor(t,e){this.query=t,e&&e.resetFn&&et().resettable&&this.onReset(e.resetFn)}getQuery(){return this.query}getStore(){return this.getQuery().__store__}isEntityBased(t){return yt(t)}selectSource(t,e){return this.isEntityBased(t)?this.getQuery().selectEntity(t).pipe(g((t=>null!=t))):e?this.getQuery().select((t=>Ct(t,this.withStoreName(e)))):this.getQuery().select()}getSource(t,e){if(this.isEntityBased(t))return this.getQuery().getEntity(t);const s=this.getQuery().getValue();return e?Ct(s,this.withStoreName(e)):s}withStoreName(t){return`${this.storeName}.${t}`}get storeName(){return this.getStore().storeName}updateStore(t,e,s,i=!1){if(this.isEntityBased(e)){const s=this.getStore();i?s.replace(e,t):s.update(e,t)}else{if(s)return void this.getStore()._setState((e=>Rt(e,this.withStoreName(s),t,!0)));const e=i?t:e=>Object.assign(Object.assign({},e),t);this.getStore()._setState(e)}}onReset(t){const e=this.getStore().reset;this.getStore().reset=(...s)=>{setTimeout((()=>{e.apply(this.getStore(),s),t()}))}}}{constructor(t,e={}){super(t,{resetFn:()=>{this.initial=!1,this.destroy({clearCache:!0,currentPage:1})}}),this.query=t,this.config=e,this.metadata=new Map,this.pages=new Map,this.pagination={currentPage:1,perPage:0,total:0,lastPage:0,data:[]},this.initial=!0,this.isLoading$=this.query.selectLoading().pipe(u(0)),this.config=Object.assign(Object.assign({},Kt),e);const{startWith:s,cacheTimeout:i}=this.config;this.page=new I(s),k(i)&&(this.clearCacheSubscription=i.subscribe((()=>this.clearCache())))}get pageChanges(){return this.page.asObservable()}get currentPage(){return this.pagination.currentPage}get isFirst(){return 1===this.currentPage}get isLast(){return this.currentPage===this.pagination.lastPage}withControls(){return this.config.pagesControls=!0,this}withRange(){return this.config.range=!0,this}setLoading(t=!0){this.getStore().setLoading(t)}update(t){this.pagination=t,this.addPage(t.data)}addPage(t){this.pages.set(this.currentPage,{ids:t.map((t=>t[this.getStore().idKey]))}),this.getStore().upsertMany(t)}clearCache(t={}){this.initial||(z("@Pagination - Clear Cache"),!1!==t.clearStore&&(this.config.clearStoreWithCache||t.clearStore)&&this.getStore().remove(),this.pages=new Map,this.metadata=new Map),this.initial=!1}clearPage(t){this.pages.delete(t)}destroy({clearCache:t,currentPage:e}={}){this.clearCacheSubscription&&this.clearCacheSubscription.unsubscribe(),t&&this.clearCache(),gt(e)||this.setPage(e),this.initial=!0}isPageActive(t){return this.currentPage===t}setPage(t){t===this.currentPage&&this.hasPage(t)||this.page.next(this.pagination.currentPage=t)}nextPage(){this.currentPage!==this.pagination.lastPage&&this.setPage(this.pagination.currentPage+1)}prevPage(){this.pagination.currentPage>1&&this.setPage(this.pagination.currentPage-1)}setLastPage(){this.setPage(this.pagination.lastPage)}setFirstPage(){this.setPage(1)}hasPage(t){return this.pages.has(t)}getPage(t){let e=this.pagination.currentPage;return this.hasPage(e)?this.selectPage(e):(this.setLoading(!0),d(t()).pipe(R((t=>(e=t.currentPage,At((()=>{this.setLoading(!1),this.update(t)})),this.selectPage(e))))))}getQuery(){return this.query}refreshCurrentPage(){!1===Y(this.currentPage)&&(this.clearPage(this.currentPage),this.setPage(this.currentPage))}getFrom(){return this.isFirst?1:(this.currentPage-1)*this.pagination.perPage+1}getTo(){return this.isLast?this.pagination.total:this.currentPage*this.pagination.perPage}selectPage(t){return this.query.selectAll({asObject:!0}).pipe((1,t=>t.lift(new j(1))),p((e=>{const s=Object.assign(Object.assign({},this.pagination),{data:this.pages.get(t).ids.map((t=>e[t]))}),{range:i,pagesControls:n}=this.config;return isNaN(this.pagination.total)&&(s.total=1===s.lastPage?s.data?s.data.length:0:s.perPage*s.lastPage,this.pagination.total=s.total),i&&(s.from=this.getFrom(),s.to=this.getTo()),n&&(s.pageControls=function(t,e){const s=Math.ceil(t/e),i=[];for(let t=0;t<s;t++)i.push(t+1);return i}(this.pagination.total,this.pagination.perPage)),s})))}}.prototype,"update",null),function(t){t.Update="UPDATE"}(Dt||(Dt={})),function(t){t.Update="UPDATE",t.AddEntities="ADD_ENTITIES",t.SetEntities="SET_ENTITIES",t.UpdateEntities="UPDATE_ENTITIES",t.RemoveEntities="REMOVE_ENTITIES",t.UpsertEntities="UPSERT_ENTITIES",t.UpsertManyEntities="UPSERT_MANY_ENTITIES"}($t||($t={}));export{xt as Q,vt as S,It as a,pt as e,Lt as p}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as s,b as t,p as e,m as a,c as o}from"./p-2c9dd7c4.js";import{a as r}from"./p-7ad92407.js";import{w as i}from"./p-5347b880.js";import{B as n,f as c,u as d,U as l}from"./p-
|
|
1
|
+
import{n as s,b as t,p as e,m as a,c as o}from"./p-2c9dd7c4.js";import{a as r}from"./p-7ad92407.js";import{w as i}from"./p-5347b880.js";import{B as n,f as c,u as d,U as l}from"./p-7062880e.js";import{S as m,a as f,Q as u}from"./p-f3effa5d.js";const h=new class{async getEditorProfiles(){return await n.instance.url("users/editors").get().json()}async assignRole(s,t){const e={command:{assignRole:t}};return n.instance.url(`users/${s}`).post(e).badRequest((()=>{throw new Error("Failed to execute user command")})).res()}};let w=class extends f{constructor(){super({editorProfiles:[],selectedEditor:s,editorLoading:!1,showRemoveEditorDialog:!1})}setEditorLoading(s){this.update((t=>{t.editorLoading=s}))}selectEditor(s){this.update((e=>{e.selectedEditor=t(s)}))}showRemoveEditorDialog(s){this.update((t=>{t.showRemoveEditorDialog=s}))}};w=function(s,t,e,a){var o,r=arguments.length,i=r<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,e):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(s,t,e,a);else for(var n=s.length-1;n>=0;n--)(o=s[n])&&(i=(r<3?o(i):r>3?o(t,e,i):o(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i}([m({name:"role-management",resettable:!0,producerFn:c})],w);const p=new w,E=new class extends u{constructor(s){super(s),this.store=s,this.editorProfiles$=this.select((s=>s.editorProfiles)),this.editorLoading$=this.select((s=>s.editorLoading)),this.showRemoveEditorDialog$=this.select((s=>s.showRemoveEditorDialog)),this.selectedEditor$=this.select((s=>s.selectedEditor))}}(p),g=new class{async getBasicProfileByEmail(s){const t=await d.getBasicProfileByEmail(s);return e(t,a((s=>s)))}async getEditorProfiles(){const s=(await h.getEditorProfiles()).map(l.toDomain);p.update((t=>{t.editorProfiles=s}))}async removeSelectedEditor(){p.showRemoveEditorDialog(!1),p.setEditorLoading(!0);const s=r(E.getValue().selectedEditor);await h.assignRole(s.basicProfile.profileId,"user"),await this.getEditorProfiles(),p.setEditorLoading(!1)}showRemoveEditorDialog(s){p.selectEditor(s),p.showRemoveEditorDialog(!0)}async addEditorByEmail(s){p.setEditorLoading(!0);const t=await i(this.getBasicProfileByEmail(s),300);return o(t)&&(await h.assignRole(t.value.profileId,"accountEditor"),await this.getEditorProfiles()),p.setEditorLoading(!1),t}};export{g as a,E as b,p as r}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __extends=this&&this.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r))t[r]=e[r]};return t(e,r)};return function(e,r){if(typeof r!=="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var __awaiter=this&&this.__awaiter||function(t,e,r,n){function o(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,i){function s(t){try{u(n.next(t))}catch(t){i(t)}}function a(t){try{u(n["throw"](t))}catch(t){i(t)}}function u(t){t.done?r(t.value):o(t.value).then(s,a)}u((n=n.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(t){return function(e){return u([t,e])}}function u(s){if(n)throw new TypeError("Generator is already executing.");while(r)try{if(n=1,o&&(i=s[0]&2?o["return"]:s[0]?o["throw"]||((i=o["return"])&&i.call(o),0):o.next)&&!(i=i.call(o,s[1])).done)return i;if(o=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;o=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1];i=s;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(s);break}if(i[2])r.ops.pop();r.trys.pop();continue}s=e.call(t,r)}catch(t){s=[6,t];o=0}finally{n=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};System.register(["./p-9a8c9350.system.js","./p-0045ce79.system.js","./p-01cc3fd8.system.js","./p-
|
|
1
|
+
var __extends=this&&this.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r))t[r]=e[r]};return t(e,r)};return function(e,r){if(typeof r!=="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var __awaiter=this&&this.__awaiter||function(t,e,r,n){function o(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,i){function s(t){try{u(n.next(t))}catch(t){i(t)}}function a(t){try{u(n["throw"](t))}catch(t){i(t)}}function u(t){t.done?r(t.value):o(t.value).then(s,a)}u((n=n.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(t){return function(e){return u([t,e])}}function u(s){if(n)throw new TypeError("Generator is already executing.");while(r)try{if(n=1,o&&(i=s[0]&2?o["return"]:s[0]?o["throw"]||((i=o["return"])&&i.call(o),0):o.next)&&!(i=i.call(o,s[1])).done)return i;if(o=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;o=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1];i=s;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(s);break}if(i[2])r.ops.pop();r.trys.pop();continue}s=e.call(t,r)}catch(t){s=[6,t];o=0}finally{n=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};System.register(["./p-9a8c9350.system.js","./p-0045ce79.system.js","./p-01cc3fd8.system.js","./p-45d6fbc2.system.js","./p-19b00569.system.js"],(function(t){"use strict";var e,r,n,o,i,s,a,u,c,f,l,d,p,h;return{setters:[function(t){e=t.n;r=t.b;n=t.p;o=t.m;i=t.c},function(t){s=t.a},function(t){a=t.w},function(t){u=t.B;c=t.f;f=t.u;l=t.U},function(t){d=t.S;p=t.a;h=t.Q}],execute:function(){var v=function(){function t(){}t.prototype.getEditorProfiles=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,u.instance.url("users/editors").get().json()];case 1:return[2,t.sent()]}}))}))};t.prototype.assignRole=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r;return __generator(this,(function(n){r={command:{assignRole:e}};return[2,u.instance.url("users/"+t).post(r).badRequest((function(){throw new Error("Failed to execute user command")})).res()]}))}))};return t}();var _=new v;var g=undefined&&undefined.__decorate||function(t,e,r,n){var o=arguments.length,i=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")i=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)if(s=t[a])i=(o<3?s(i):o>3?s(e,r,i):s(e,r))||i;return o>3&&i&&Object.defineProperty(e,r,i),i};function y(){return{editorProfiles:[],selectedEditor:e,editorLoading:false,showRemoveEditorDialog:false}}var w=function(t){__extends(e,t);function e(){return t.call(this,y())||this}e.prototype.setEditorLoading=function(t){this.update((function(e){e.editorLoading=t}))};e.prototype.selectEditor=function(t){this.update((function(e){e.selectedEditor=r(t)}))};e.prototype.showRemoveEditorDialog=function(t){this.update((function(e){e.showRemoveEditorDialog=t}))};return e}(p);w=g([d({name:"role-management",resettable:true,producerFn:c})],w);var E=t("r",new w);var b=function(t){__extends(e,t);function e(e){var r=t.call(this,e)||this;r.store=e;r.editorProfiles$=r.select((function(t){return t.editorProfiles}));r.editorLoading$=r.select((function(t){return t.editorLoading}));r.showRemoveEditorDialog$=r.select((function(t){return t.showRemoveEditorDialog}));r.selectedEditor$=r.select((function(t){return t.selectedEditor}));return r}return e}(h);var m=t("b",new b(E));var P=function(){function t(){}t.prototype.getBasicProfileByEmail=function(t){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(r){switch(r.label){case 0:return[4,f.getBasicProfileByEmail(t)];case 1:e=r.sent();return[2,n(e,o((function(t){return t})))]}}))}))};t.prototype.getEditorProfiles=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){switch(e.label){case 0:return[4,_.getEditorProfiles()];case 1:t=e.sent().map(l.toDomain);E.update((function(e){e.editorProfiles=t}));return[2]}}))}))};t.prototype.removeSelectedEditor=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){switch(e.label){case 0:E.showRemoveEditorDialog(false);E.setEditorLoading(true);t=s(m.getValue().selectedEditor);return[4,_.assignRole(t.basicProfile.profileId,"user")];case 1:e.sent();return[4,this.getEditorProfiles()];case 2:e.sent();E.setEditorLoading(false);return[2]}}))}))};t.prototype.showRemoveEditorDialog=function(t){E.selectEditor(t);E.showRemoveEditorDialog(true)};t.prototype.addEditorByEmail=function(t){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(r){switch(r.label){case 0:E.setEditorLoading(true);return[4,a(this.getBasicProfileByEmail(t),300)];case 1:e=r.sent();if(!i(e))return[3,4];return[4,_.assignRole(e.value.profileId,"accountEditor")];case 2:r.sent();return[4,this.getEditorProfiles()];case 3:r.sent();r.label=4;case 4:E.setEditorLoading(false);return[2,e]}}))}))};return t}();var R=t("a",new P)}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as s,h as e,H as i}from"./p-91e1cdd0.js";import{i as a}from"./p-2c9dd7c4.js";import{a as n,b as l}from"./p-
|
|
1
|
+
import{r as t,c as s,h as e,H as i}from"./p-91e1cdd0.js";import{i as a}from"./p-2c9dd7c4.js";import{a as n,b as l}from"./p-fa160c9f.js";import{a as r}from"./p-ea120e31.js";import"./p-7ad92407.js";import"./p-5347b880.js";import"./p-7062880e.js";import"./p-f3effa5d.js";import"./p-054d1471.js";import"./p-f63d9d89.js";const c=class{constructor(e){t(this,e),this.accepted=s(this,"accepted",7),this.declined=s(this,"declined",7),this.cancelled=s(this,"cancelled",7),this.dialogStyle="success",this.allowedDialogStyles=["success","danger","warning","info"]}componentWillLoad(){this.validateDialogStyle()}componentDidUpdate(){this.validateDialogStyle()}render(){return e("div",{class:"uiid-delete-benefit-popup"},e("div",{class:"my-3"},e("slot",null)),e("div",{class:"text-right"},e("button",{class:`uiid-confirm-delete-benefit-item btn btn-${this.dialogStyle} mr-3`,onClick:()=>{var t;null===(t=this.accepted)||void 0===t||t.emit()}},this.acceptText||"Accept"),e("button",{class:"btn btn-light",onClick:()=>{var t;null===(t=this.declined)||void 0===t||t.emit()}},this.declineText||"Decline")))}validateDialogStyle(){this.allowedDialogStyles.some((t=>t===this.dialogStyle))||(this.dialogStyle="success")}},o=class{constructor(s){t(this,s),this.storeSubscription=new r,this.isEmailValid=!1,this.displayInvalidEmailError=!1,this.emailNotExist=!1,this.isLoading=!1,this.emailRegex=/(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])/,this.editorItem=t=>{const{basicProfile:s,benefitsProfile:i}=t;return e("tr",null,e("td",null,s.firstName),e("td",null,s.email),e("td",null,(t=>{switch(t){case"accountAdmin":return"Admin";case"accountEditor":return"Editor";case"user":return"User";default:return"Unknown"}})(i.role)),e("td",{class:"text-center"},e("a",{href:"#",onClick:s=>{s.preventDefault(),n.showRemoveEditorDialog(t)}},"Remove")))}}componentWillLoad(){this.storeSubscription.add(l.editorProfiles$.subscribe((t=>this.editorProfiles=t))),this.storeSubscription.add(l.editorLoading$.subscribe((t=>this.isLoading=t)))}disconnectedCallback(){this.storeSubscription.unsubscribe()}render(){return e(i,null,e("h5",null,"Editors"),e("hr",null),e("form",{class:"needs-validation",novalidate:!0,ref:t=>this.form=t},e("div",{class:"d-flex align-items-start flex-column"},e("h6",null,"Add new editor"),e("div",{class:"d-flex align-items-center "+(this.displayInvalidEmailError?"was-validated":"")},e("input",{type:"text",name:"editorEmail",maxLength:50,required:!0,class:"form-control w-auto "+(this.emailNotExist?"is-invalid":""),onFocus:()=>{this.emailNotExist=!1,this.displayInvalidEmailError=!1},pattern:this.emailRegex.source}),e("fl-button",{onClick:async t=>this.addEditorHandler(t),class:"ml-3"},e("div",{class:"d-flex"},e("ap-ben-icon",{class:"fa mr-2",iconPrefix:"fad",iconId:"user-plus"}),e("div",null,"Add"))),e("fl-loading-indicator",{class:"ml-3 "+(this.isLoading?"":"d-none")}),e("div",{class:"invalid-feedback ml-3 flex-grow-2"},this.emailNotExist?"Email not exists, please check again.":"Please input a valid Email.")))),e("div",{class:"border rounded mt-4 px-0"},e("table",{class:"table m-0"},e("thead",{class:"thead-light"},e("tr",null,e("th",{scope:"col"},"NAME"),e("th",{scope:"col"},"EMAIL"),e("th",{scope:"col"},"ROLE"),e("th",{scope:"col"}))),e("tbody",null,this.editorProfiles.map(this.editorItem)))))}async addEditorHandler(t){if(t.preventDefault(),this.isEmailValid=this.form.checkValidity(),this.displayInvalidEmailError=!this.isEmailValid,!this.isEmailValid)return;const s=this.form.elements.namedItem("editorEmail"),e=await n.addEditorByEmail(s.value);a(e)?this.emailNotExist=!0:s.value=""}},d=class{constructor(s){t(this,s)}render(){const t=this.owner.basicProfile;return e(i,null,e("h5",null,"Owner"),e("hr",null),e("div",{class:"d-flex border rounded px-3"},e("div",{class:"d-flex flex-wrap align-content-center"},e("ap-ben-icon",{class:"text-black-50 fa-4x",iconPrefix:"fad",iconId:"user-circle"})),e("div",{class:"d-flex align-items-start flex-column m-3"},e("h5",null,e("b",null,`${t.firstName} ${t.lastName}`)),e("div",null,t.email))))}},h=class{constructor(s){t(this,s),this.isAppInitialised=!1}componentDidLoad(){this.isAppInitialised=!0}render(){return e(i,{class:{"slide-fwd-center":!0,"d-none":!this.isAppInitialised,"d-block":this.isAppInitialised}},e("slot",null))}};h.style=".slide-fwd-center{-webkit-animation:slide-fwd-center 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;animation:slide-fwd-center 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;}@-webkit-keyframes slide-fwd-center{0%{-webkit-transform:translateY(-10px);transform:translateY(-10px);opacity:0.5}100%{-webkit-transform:translateY(0px);transform:translateY(0px);opacity:1}}@keyframes slide-fwd-center{0%{-webkit-transform:translateY(-10px);transform:translateY(-10px);opacity:0.5}100%{-webkit-transform:translateY(0px);transform:translateY(0px);opacity:1}}";export{c as ap_ben_confirm_dialog,o as ap_ben_role_editors_section,d as ap_ben_role_owner_section,h as ap_ben_ui_container}
|
|
@@ -6,7 +6,7 @@ const index = require('./index-d685a739.js');
|
|
|
6
6
|
const index$1 = require('./index-4f00f593.js');
|
|
7
7
|
const index$2 = require('./index-889ce6c6.js');
|
|
8
8
|
const Option = require('./Option-98dab0b8.js');
|
|
9
|
-
const datoramaAkita = require('./datorama-akita-
|
|
9
|
+
const datoramaAkita = require('./datorama-akita-bb801820.js');
|
|
10
10
|
const delay = require('./delay-e91dba76.js');
|
|
11
11
|
require('./scheduleArray-0ba3d6f8.js');
|
|
12
12
|
require('./filter-c38164e6.js');
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-d685a739.js');
|
|
6
|
-
const eventTracking_service = require('./event-tracking.service-
|
|
7
|
-
require('./api-client-
|
|
6
|
+
const eventTracking_service = require('./event-tracking.service-fcc820f1.js');
|
|
7
|
+
require('./api-client-00edc9b6.js');
|
|
8
8
|
require('./index-4f00f593.js');
|
|
9
9
|
require('./index-889ce6c6.js');
|
|
10
|
-
require('./datorama-akita-
|
|
10
|
+
require('./datorama-akita-bb801820.js');
|
|
11
11
|
require('./scheduleArray-0ba3d6f8.js');
|
|
12
12
|
require('./delay-e91dba76.js');
|
|
13
13
|
require('./filter-c38164e6.js');
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-d685a739.js');
|
|
6
|
-
const eventTracking_service = require('./event-tracking.service-
|
|
7
|
-
require('./api-client-
|
|
6
|
+
const eventTracking_service = require('./event-tracking.service-fcc820f1.js');
|
|
7
|
+
require('./api-client-00edc9b6.js');
|
|
8
8
|
require('./index-4f00f593.js');
|
|
9
9
|
require('./index-889ce6c6.js');
|
|
10
|
-
require('./datorama-akita-
|
|
10
|
+
require('./datorama-akita-bb801820.js');
|
|
11
11
|
require('./scheduleArray-0ba3d6f8.js');
|
|
12
12
|
require('./delay-e91dba76.js');
|
|
13
13
|
require('./filter-c38164e6.js');
|
|
@@ -4,19 +4,19 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-d685a739.js');
|
|
6
6
|
const Option = require('./Option-98dab0b8.js');
|
|
7
|
-
const manageBenefits_service = require('./manage-benefits.service-
|
|
7
|
+
const manageBenefits_service = require('./manage-benefits.service-f45b4602.js');
|
|
8
8
|
const scheduleArray = require('./scheduleArray-0ba3d6f8.js');
|
|
9
9
|
const index$1 = require('./index-4f00f593.js');
|
|
10
|
-
const apiClient = require('./api-client-
|
|
10
|
+
const apiClient = require('./api-client-00edc9b6.js');
|
|
11
11
|
const index$2 = require('./index-889ce6c6.js');
|
|
12
|
-
const benefitsApp_query = require('./benefits-app.query-
|
|
13
|
-
const roleManagement_service = require('./role-management.service-
|
|
12
|
+
const benefitsApp_query = require('./benefits-app.query-98898e4c.js');
|
|
13
|
+
const roleManagement_service = require('./role-management.service-2109723c.js');
|
|
14
14
|
const activeRouter = require('./active-router-3742ead6.js');
|
|
15
|
-
require('./datorama-akita-
|
|
15
|
+
require('./datorama-akita-bb801820.js');
|
|
16
16
|
require('./delay-e91dba76.js');
|
|
17
17
|
require('./filter-c38164e6.js');
|
|
18
18
|
require('./promise-f77cab90.js');
|
|
19
|
-
require('./benefits.api-
|
|
19
|
+
require('./benefits.api-a4bd9804.js');
|
|
20
20
|
|
|
21
21
|
const benefitUrlCss = "ap-ben-benefit-url .blur-backdrop{opacity:0;position:fixed;top:0;left:0;width:100%;height:100%}";
|
|
22
22
|
|
|
@@ -4,11 +4,11 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-d685a739.js');
|
|
6
6
|
const Option = require('./Option-98dab0b8.js');
|
|
7
|
-
const eventTracking_service = require('./event-tracking.service-
|
|
8
|
-
require('./api-client-
|
|
7
|
+
const eventTracking_service = require('./event-tracking.service-fcc820f1.js');
|
|
8
|
+
require('./api-client-00edc9b6.js');
|
|
9
9
|
require('./index-4f00f593.js');
|
|
10
10
|
require('./index-889ce6c6.js');
|
|
11
|
-
require('./datorama-akita-
|
|
11
|
+
require('./datorama-akita-bb801820.js');
|
|
12
12
|
require('./scheduleArray-0ba3d6f8.js');
|
|
13
13
|
require('./delay-e91dba76.js');
|
|
14
14
|
require('./filter-c38164e6.js');
|
|
@@ -4,11 +4,11 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index$1 = require('./index-d685a739.js');
|
|
6
6
|
const index = require('./index-4f00f593.js');
|
|
7
|
-
const benefits_api = require('./benefits.api-
|
|
8
|
-
const eventTracking_service = require('./event-tracking.service-
|
|
9
|
-
require('./api-client-
|
|
7
|
+
const benefits_api = require('./benefits.api-a4bd9804.js');
|
|
8
|
+
const eventTracking_service = require('./event-tracking.service-fcc820f1.js');
|
|
9
|
+
require('./api-client-00edc9b6.js');
|
|
10
10
|
require('./index-889ce6c6.js');
|
|
11
|
-
require('./datorama-akita-
|
|
11
|
+
require('./datorama-akita-bb801820.js');
|
|
12
12
|
require('./scheduleArray-0ba3d6f8.js');
|
|
13
13
|
require('./delay-e91dba76.js');
|
|
14
14
|
require('./filter-c38164e6.js');
|
|
@@ -4,12 +4,12 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-d685a739.js');
|
|
6
6
|
const index$1 = require('./index-4f00f593.js');
|
|
7
|
-
const roleManagement_service = require('./role-management.service-
|
|
7
|
+
const roleManagement_service = require('./role-management.service-2109723c.js');
|
|
8
8
|
const scheduleArray = require('./scheduleArray-0ba3d6f8.js');
|
|
9
9
|
require('./index-889ce6c6.js');
|
|
10
10
|
require('./promise-f77cab90.js');
|
|
11
|
-
require('./api-client-
|
|
12
|
-
require('./datorama-akita-
|
|
11
|
+
require('./api-client-00edc9b6.js');
|
|
12
|
+
require('./datorama-akita-bb801820.js');
|
|
13
13
|
require('./delay-e91dba76.js');
|
|
14
14
|
require('./filter-c38164e6.js');
|
|
15
15
|
|
|
@@ -6,17 +6,17 @@ const index = require('./index-d685a739.js');
|
|
|
6
6
|
const index$1 = require('./index-4f00f593.js');
|
|
7
7
|
const index$2 = require('./index-889ce6c6.js');
|
|
8
8
|
const navigation_service = require('./navigation.service-23bf9ce2.js');
|
|
9
|
-
const manageBenefits_service = require('./manage-benefits.service-
|
|
9
|
+
const manageBenefits_service = require('./manage-benefits.service-f45b4602.js');
|
|
10
10
|
const scheduleArray = require('./scheduleArray-0ba3d6f8.js');
|
|
11
11
|
const activeRouter = require('./active-router-3742ead6.js');
|
|
12
12
|
require('./Option-98dab0b8.js');
|
|
13
13
|
require('./iframe-a50670af.js');
|
|
14
|
-
require('./datorama-akita-
|
|
14
|
+
require('./datorama-akita-bb801820.js');
|
|
15
15
|
require('./delay-e91dba76.js');
|
|
16
16
|
require('./filter-c38164e6.js');
|
|
17
|
-
require('./api-client-
|
|
17
|
+
require('./api-client-00edc9b6.js');
|
|
18
18
|
require('./promise-f77cab90.js');
|
|
19
|
-
require('./benefits.api-
|
|
19
|
+
require('./benefits.api-a4bd9804.js');
|
|
20
20
|
|
|
21
21
|
const EditBenefitPage = class {
|
|
22
22
|
constructor(hostRef) {
|