PageSourceSearch

https://www.rospa.com/2cf86935f25d3d74c573.js

js rospa.com collected 2026-10-02 02:34:08 UTC 5,711 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkWeb=self.webpackChunkWeb||[]).push([[516],{4516:(t,e,n)=>{n.r(e),n.d(e,{default:()=>g});var i=n(1571),r=n(2842),o=n(541),s=n(665),a=n(1467),c=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function s(t){try{c(i.next(t))}catch(t){o(t)}}function a(t){try{c(i.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((i=i.apply(t,e||[])).next())}))},d=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};const h=new r.tgq(s.A),u=t=>{const e=[];return function t(n){if(!n)return;const{children:i}=n,r=d(n,["children"]);e.push(r),i&&(null==i?void 0:i.length)&&i.forEach((e=>t(e)))}(t),e},l=(t,e)=>{for(const n of t){if(n.organizationId===e)return n;if(n.children&&n.children.length>0){if(l(n.children,e))return n}}return null},g={org:[],flatCurrentOrg:[],currentOrgName:"",currentOrgId:"",currentCxeAccountId:"",addSiteParent:{},showAddSite:!1,showEditSite:!1,saving:!1,loading:!1,contacts:[],orgLoaded:!1,currentLoaded:!1,contactsLoaded:!1,initialized:!1,_cxeContactsPromise:null,_getPromise:null,_currentPromise:null,Reset(){this.showAddSite=!1,this.showEditSite=!1},ClearCache(){this.orgLoaded=!1,this.currentLoaded=!1,this.contactsLoaded=!1,this._getPromise=null,this._currentPromise=null,this._cxeContactsPromise=null,this.initialized&&Promise.all([this.Get(),this.Current(),this.GetCxeContacts(this.currentCxeAccountId)])},Init(){return c(this,void 0,void 0,(function*(){this.initialized=!0,yield Promise.all([this.Get(),this.Current()])}))},Get(){return this.initialized?this.orgLoaded?Promise.resolve(this.org):(this._getPromise||(this.loading=!0,this._getPromise=h.apiOrganizationGet().then((t=>{if(this.org=t,this.orgLoaded=!0,this.loading=!1,this._getPromise=null,this.currentOrgId){const t=l(this.org,this.currentOrgId);this.flatCurrentOrg=u(t)}return t})).catch((t=>{throw this.loading=!1,this._getPromise=null,t}))),this._getPromise):Promise.resolve([])},GetCxeContacts(t){if(!this.initialized)return Promise.resolve([]);if(0==(null==t?void 0:t.length)&&(t=this.currentCxeAccountId),this.contactsLoaded)return Promise.resolve(this.contacts);if(this._cxeContactsPromise)return this._cxeContactsPromise;const e={cxeAccountId:t};return this._cxeContactsPromise=h.apiOrganizationContactsGet(e).then((t=>(this.contacts=t,this._cxeContactsPromise=null,this.contactsLoaded=!0,t))).catch((t=>{throw this._cxeContactsPromise=null,this.contactsLoaded=!1,t})),this._cxeContactsPromise},GetAdditionalCxeContacts(t){if(!this.initialized)return Promise.resolve([]);const e={cxeAccountId:t};return h.apiOrganizationContactsGet(e).then((t=>t)).catch((t=>{throw t}))},GetAddresses(t){if(t&&0!==t.length||(t=this.currentOrgId),!t)return console.warn("No organization ID provided and no current organization set"),Promise.resolve([]);try{var e={cxeAccountId:t};return h.apiOrganizationAddressesGet(e)}catch(e){return console.error(`GetAddresses failed for org ${t}`,e),Promise.resolve([])}},Current(){return this.initialized?this.currentLoaded?Promise.resolve({organizationId:this.currentOrgId,cxeAccountId:this.currentCxeAccountId,name:this.currentOrgName}):(this._currentPromise||(this._currentPromise=h.apiOrganizationCurrentGet().then((t=>{this.currentOrgId=t.organizationId,this.currentCxeAccountId=t.cxeAccountId,this.currentOrgName=t.name;const e=l(this.org,this.currentOrgId);return this.flatCurrentOrg=u(e),this.currentLoaded=!0,this._currentPromise=null,this.loading=!1,t})).catch((t=>{throw this._currentPromise=null,t}))),this._currentPromise):Promise.resolve({organizationId:"",cxeAccountId:"",name:""})},SetCurrent(t){if(this.loading)return console.warn("Organization switch already in progress"),Promise.reject("Organization switch already in progress");this.loading=!0;const e={orgId:t};return h.apiOrganizationCurrentPut(e).then((()=>(this.ClearCache(),this.contacts=[],this.contactsLoaded=!1,this._cxeContactsPromise=null,Alpine.store(i.I.Cart).Get(),Alpine.store(i.I.Hierarchy).ClearCache(),this.Current().then((t=>(window.dispatchEvent(new CustomEvent("organization:changed",{detail:{orgId:t.organizationId,cxeAccountId:t.cxeAccountId,name:t.name}})),t)))))).finally((()=>{this.loading=!1}))},AddSite(t,e){this.saving=!0;const n={newOrganizationRequest:t};h.apiOrganizationSitePost(n).then((()=>(this.ClearCache(),Alpine.store(i.I.Hierarchy).ClearCache(),this.Get()))).then((()=>{(0,a.WB)(null==e?void 0:e.currentTarget,{formCategory:"Organization",formName:"Site"===t.organizationType?"Add site":"Add organisation"}),this.loading=!1,this.saving=!1,document.getElementById("notifications").dispatchEvent(new CustomEvent("notice",{detail:{type:"success",text:"Added - "+t.name},bubbles:!0}))}
1)).catch((()=>{this.saving=!1,document.getElementById("notifications").dispatchEvent(new CustomEvent("notice",{detail:{type:"error",text:"Unable to add organisation"},bubbles:!0}))}))},DeactivateSite(t,e,n,r,s){return c(this,void 0,void 0,(function*(){const a=t.name||t.organizationId,c=`${e}\n\n- ${a}`;yield(0,o.u)("Deactivate Organisation",c,r,s,!0,(e=>{if(e.success){const r={orgId:t.organizationId,reason:e.reason,contentId:n};h.apiOrganizationSitePut(r).then((t=>{this.ClearCache(),Alpine.store(i.I.Hierarchy).ClearCache(),document.getElementById("notifications").dispatchEvent(new CustomEvent("notice",{detail:{type:t.notificationType.toLowerCase(),text:t.notificationMessage},bubbles:!0}))}))}}))}))}}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.