@dropins/storefront-company-management 1.0.0-beta2 → 1.0.0-beta21
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/api/allowCompanyRegistration/allowCompanyRegistration.d.ts +18 -0
- package/api/allowCompanyRegistration/graphql/allowCompanyRegistration.graphql.d.ts +18 -0
- package/api/allowCompanyRegistration/index.d.ts +18 -0
- package/api/checkCompanyCreditEnabled/checkCompanyCreditEnabled.d.ts +4 -0
- package/api/checkCompanyCreditEnabled/graphql/checkCompanyCreditEnabled.graphql.d.ts +18 -0
- package/api/checkCompanyCreditEnabled/index.d.ts +18 -0
- package/api/companyEnabled/companyEnabled.d.ts +18 -0
- package/api/companyEnabled/graphql/companyEnabled.graphql.d.ts +18 -0
- package/api/{checkIsCompanyEnabled → companyEnabled}/index.d.ts +1 -1
- package/api/companyRoles/createCompanyRole.d.ts +7 -0
- package/api/companyRoles/deleteCompanyRole.d.ts +7 -0
- package/api/companyRoles/getCompanyAclResources.d.ts +7 -0
- package/api/companyRoles/getCompanyRole.d.ts +8 -0
- package/api/companyRoles/getCompanyRoles.d.ts +8 -0
- package/api/companyRoles/graphql/fragments.d.ts +18 -0
- package/api/companyRoles/graphql/index.d.ts +20 -0
- package/api/companyRoles/graphql/mutations.d.ts +20 -0
- package/api/companyRoles/graphql/queries.d.ts +21 -0
- package/api/companyRoles/index.d.ts +27 -0
- package/api/companyRoles/isCompanyRoleNameAvailable.d.ts +7 -0
- package/api/companyRoles/updateCompanyRole.d.ts +7 -0
- package/api/companyRoles/utils.d.ts +11 -0
- package/api/createCompany/createCompany.d.ts +39 -0
- package/api/createCompany/graphql/createCompany.graphql.d.ts +18 -0
- package/api/createCompany/index.d.ts +18 -0
- package/api/createCompanyTeam/createCompanyTeam.d.ts +11 -0
- package/api/createCompanyTeam/graphql/createCompanyTeam.graphql.d.ts +18 -0
- package/api/createCompanyTeam/index.d.ts +18 -0
- package/api/createCompanyUser/createCompanyUser.d.ts +9 -0
- package/api/createCompanyUser/graphql/createCompanyUser.graphql.d.ts +18 -0
- package/api/createCompanyUser/index.d.ts +18 -0
- package/api/deleteCompanyTeam/deleteCompanyTeam.d.ts +9 -0
- package/api/deleteCompanyTeam/graphql/deleteCompanyTeam.graphql.d.ts +18 -0
- package/api/deleteCompanyTeam/index.d.ts +18 -0
- package/api/deleteCompanyUser/deleteCompanyUser.d.ts +10 -0
- package/api/deleteCompanyUser/graphql/deleteCompanyUser.graphql.d.ts +18 -0
- package/api/deleteCompanyUser/index.d.ts +18 -0
- package/api/fetchUserPermissions/fetchUserPermissions.d.ts +11 -0
- package/api/{getCompany → fetchUserPermissions}/graphql/getCustomerRole.graphql.d.ts +1 -1
- package/api/fetchUserPermissions/index.d.ts +18 -0
- package/api/getCompany/getCompany.d.ts +9 -3
- package/api/getCompanyCredit/getCompanyCredit.d.ts +4 -0
- package/api/getCompanyCredit/graphql/getCompanyCredit.graphql.d.ts +18 -0
- package/api/getCompanyCredit/index.d.ts +18 -0
- package/api/getCompanyCreditHistory/getCompanyCreditHistory.d.ts +5 -0
- package/api/getCompanyCreditHistory/graphql/getCompanyCreditHistory.graphql.d.ts +18 -0
- package/api/getCompanyCreditHistory/index.d.ts +19 -0
- package/api/getCompanyStructure/getCompanyStructure.d.ts +10 -0
- package/api/getCompanyStructure/graphql/getCompanyStructure.graphql.d.ts +18 -0
- package/api/getCompanyStructure/index.d.ts +18 -0
- package/api/getCompanyTeam/getCompanyTeam.d.ts +11 -0
- package/api/getCompanyTeam/graphql/getCompanyTeam.graphql.d.ts +18 -0
- package/api/getCompanyTeam/index.d.ts +18 -0
- package/api/getCompanyUser/getCompanyUser.d.ts +9 -0
- package/api/getCompanyUser/graphql/getCompanyUser.graphql.d.ts +18 -0
- package/api/getCompanyUser/index.d.ts +18 -0
- package/api/getCompanyUsers/getCompanyUsers.d.ts +12 -0
- package/api/getCompanyUsers/graphql/companyUsers.graphql.d.ts +18 -0
- package/api/getCompanyUsers/index.d.ts +18 -0
- package/api/getCustomerCompany/getCustomerCompany.d.ts +12 -0
- package/api/getCustomerCompany/graphql/getCustomerCompanyInfo.graphql.d.ts +18 -0
- package/api/getCustomerCompany/index.d.ts +18 -0
- package/api/getStoreConfig/getStoreConfig.d.ts +6 -0
- package/api/getStoreConfig/graphql/getStoreConfig.graphql.d.ts +18 -0
- package/api/getStoreConfig/index.d.ts +18 -0
- package/api/graphql/buildCompanyQueries.d.ts +9 -0
- package/api/index.d.ts +26 -2
- package/api/initialize/initialize.d.ts +2 -20
- package/api/isCompanyAdmin/graphql/isCompanyAdmin.graphql.d.ts +18 -0
- package/api/isCompanyAdmin/index.d.ts +18 -0
- package/api/isCompanyAdmin/isCompanyAdmin.d.ts +22 -0
- package/api/isCompanyUser/graphql/isCompanyUser.graphql.d.ts +18 -0
- package/api/isCompanyUser/index.d.ts +18 -0
- package/api/isCompanyUser/isCompanyUser.d.ts +22 -0
- package/api/isCompanyUserEmailAvailable/graphql/isCompanyUserEmailAvailable.graphql.d.ts +18 -0
- package/api/isCompanyUserEmailAvailable/index.d.ts +18 -0
- package/api/isCompanyUserEmailAvailable/isCompanyUserEmailAvailable.d.ts +7 -0
- package/api/updateCompanyStructure/graphql/updateCompanyStructure.graphql.d.ts +18 -0
- package/api/updateCompanyStructure/index.d.ts +18 -0
- package/api/updateCompanyStructure/updateCompanyStructure.d.ts +11 -0
- package/api/updateCompanyTeam/graphql/updateCompanyTeam.graphql.d.ts +18 -0
- package/api/updateCompanyTeam/index.d.ts +18 -0
- package/api/updateCompanyTeam/updateCompanyTeam.d.ts +11 -0
- package/api/updateCompanyUser/graphql/updateCompanyUser.graphql.d.ts +18 -0
- package/api/updateCompanyUser/index.d.ts +18 -0
- package/api/updateCompanyUser/updateCompanyUser.d.ts +9 -0
- package/api/updateCompanyUserStatus/graphql/updateCompanyUserStatus.graphql.d.ts +18 -0
- package/api/updateCompanyUserStatus/index.d.ts +18 -0
- package/api/updateCompanyUserStatus/updateCompanyUserStatus.d.ts +11 -0
- package/api.js +22 -1
- package/api.js.map +1 -1
- package/chunks/CompanyLoaders.js +4 -0
- package/chunks/CompanyLoaders.js.map +1 -0
- package/chunks/CompanyUserForm.js +4 -0
- package/chunks/CompanyUserForm.js.map +1 -0
- package/chunks/Tree.js +4 -0
- package/chunks/Tree.js.map +1 -0
- package/chunks/acdl.js +4 -0
- package/chunks/acdl.js.map +1 -0
- package/chunks/company-permissions.js +4 -0
- package/chunks/company-permissions.js.map +1 -0
- package/chunks/fetch-error.js +4 -0
- package/chunks/fetch-error.js.map +1 -0
- package/chunks/fetchUserPermissions.js +34 -0
- package/chunks/fetchUserPermissions.js.map +1 -0
- package/chunks/getCompanyCreditHistory.js +68 -0
- package/chunks/getCompanyCreditHistory.js.map +1 -0
- package/chunks/getCustomerCompany.js +26 -0
- package/chunks/getCustomerCompany.js.map +1 -0
- package/chunks/isCompanyRoleNameAvailable.js +121 -0
- package/chunks/isCompanyRoleNameAvailable.js.map +1 -0
- package/chunks/isCompanyUser.js +21 -0
- package/chunks/isCompanyUser.js.map +1 -0
- package/chunks/network-error.js +4 -0
- package/chunks/network-error.js.map +1 -0
- package/chunks/transform-store-config.js +44 -0
- package/chunks/transform-store-config.js.map +1 -0
- package/chunks/updateCompany.js +70 -0
- package/chunks/updateCompany.js.map +1 -0
- package/chunks/updateCompanyTeam.js +42 -0
- package/chunks/updateCompanyTeam.js.map +1 -0
- package/chunks/updateCompanyUser.js +37 -0
- package/chunks/updateCompanyUser.js.map +1 -0
- package/chunks/updateCompanyUserStatus.js +39 -0
- package/chunks/updateCompanyUserStatus.js.map +1 -0
- package/chunks/useCompanyContextListener.js +4 -0
- package/chunks/useCompanyContextListener.js.map +1 -0
- package/chunks/useCompanyRoles.js +4 -0
- package/chunks/useCompanyRoles.js.map +1 -0
- package/chunks/useCustomerCompanyInfo.js +4 -0
- package/chunks/useCustomerCompanyInfo.js.map +1 -0
- package/chunks/useInLineAlert.js +4 -0
- package/chunks/useInLineAlert.js.map +1 -0
- package/chunks/useUserPermissions.js +4 -0
- package/chunks/useUserPermissions.js.map +1 -0
- package/chunks/validateCompanyEmail.js +29 -0
- package/chunks/validateCompanyEmail.js.map +1 -0
- package/components/CompanyCreditDisplay/CompanyCreditDisplay.d.ts +7 -0
- package/components/CompanyCreditDisplay/index.d.ts +19 -0
- package/components/CompanyCreditHistoryDisplay/CompanyCreditHistoryDisplay.d.ts +15 -0
- package/components/CompanyCreditHistoryDisplay/index.d.ts +19 -0
- package/components/CompanyLoaders/CompanyLoaders.d.ts +14 -0
- package/components/CompanyRegistrationForm/CompanyRegistrationForm.d.ts +13 -0
- package/components/CompanyRegistrationForm/Form/Form.d.ts +5 -0
- package/components/CompanyRegistrationForm/Form/FormInputs/FormInputs.d.ts +5 -0
- package/components/CompanyRegistrationForm/Form/FormInputs/index.d.ts +18 -0
- package/components/CompanyRegistrationForm/Form/fieldHandlers.d.ts +26 -0
- package/components/CompanyRegistrationForm/Form/fieldValidationRules.d.ts +63 -0
- package/components/CompanyRegistrationForm/Form/formValidation.d.ts +17 -0
- package/components/CompanyRegistrationForm/Form/getCompanyFieldsConfig.d.ts +13 -0
- package/components/CompanyRegistrationForm/Form/index.d.ts +18 -0
- package/components/CompanyRegistrationForm/index.d.ts +20 -0
- package/components/CompanyRegistrationSuccess/CompanyRegistrationSuccess.d.ts +8 -0
- package/components/CompanyRegistrationSuccess/index.d.ts +18 -0
- package/components/CompanyStructureCard/CompanyStructureCard.d.ts +12 -0
- package/components/CompanyStructureCard/index.d.ts +18 -0
- package/components/CompanyStructureEmpty/CompanyStructureEmpty.d.ts +9 -0
- package/components/CompanyStructureEmpty/index.d.ts +19 -0
- package/components/CompanyTeamForm/CompanyTeamForm.d.ts +17 -0
- package/components/CompanyTeamForm/index.d.ts +18 -0
- package/components/CompanyUserForm/CompanyUserForm.d.ts +10 -0
- package/components/CompanyUserForm/index.d.ts +18 -0
- package/components/CompanyUsersFilters/CompanyUsersFilters.d.ts +29 -0
- package/components/CompanyUsersFilters/index.d.ts +18 -0
- package/components/CompanyUsersManagementModal/CompanyUsersManagementModal.d.ts +18 -0
- package/components/CompanyUsersManagementModal/index.d.ts +19 -0
- package/components/CustomerCompanyInfoCard/CustomerCompanyInfoCard.d.ts +9 -0
- package/components/CustomerCompanyInfoCard/index.d.ts +18 -0
- package/components/DeleteRoleModal/DeleteRoleModal.d.ts +9 -0
- package/components/DeleteRoleModal/index.d.ts +19 -0
- package/components/EditCompanyProfile/CompanyAccountFields.d.ts +1 -2
- package/components/EditCompanyProfile/LegalAddressFields.d.ts +1 -1
- package/components/EditRoleAndPermission/EditRoleAndPermission.d.ts +24 -0
- package/components/EditRoleAndPermission/index.d.ts +19 -0
- package/components/RoleAndPermissionTable/RoleAndPermissionTable.d.ts +23 -0
- package/components/RoleAndPermissionTable/index.d.ts +19 -0
- package/components/Tree/Tree.d.ts +62 -0
- package/components/Tree/index.d.ts +18 -0
- package/components/index.d.ts +15 -0
- package/containers/CompanyCredit/CompanyCredit.d.ts +16 -0
- package/containers/CompanyCredit/index.d.ts +19 -0
- package/containers/CompanyCredit.d.ts +3 -0
- package/containers/CompanyCredit.js +4 -0
- package/containers/CompanyCredit.js.map +1 -0
- package/containers/CompanyProfile.js +1 -1
- package/containers/CompanyProfile.js.map +1 -1
- package/containers/CompanyRegistration/CompanyRegistration.d.ts +15 -0
- package/containers/CompanyRegistration/index.d.ts +19 -0
- package/containers/CompanyRegistration.d.ts +3 -0
- package/containers/CompanyRegistration.js +4 -0
- package/containers/CompanyRegistration.js.map +1 -0
- package/containers/CompanyStructure/CompanyStructure.d.ts +5 -0
- package/containers/CompanyStructure/index.d.ts +19 -0
- package/containers/CompanyStructure.d.ts +3 -0
- package/containers/CompanyStructure.js +4 -0
- package/containers/CompanyStructure.js.map +1 -0
- package/containers/CompanyUsers/CompanyUsers.d.ts +7 -0
- package/containers/CompanyUsers/index.d.ts +19 -0
- package/containers/CompanyUsers.d.ts +3 -0
- package/containers/CompanyUsers.js +4 -0
- package/containers/CompanyUsers.js.map +1 -0
- package/containers/CustomerCompanyInfo/CustomerCompanyInfo.d.ts +9 -0
- package/containers/CustomerCompanyInfo/index.d.ts +19 -0
- package/containers/CustomerCompanyInfo.d.ts +1 -0
- package/containers/CustomerCompanyInfo.js +4 -0
- package/containers/CustomerCompanyInfo.js.map +1 -0
- package/containers/RolesAndPermissions/RolesAndPermissions.d.ts +8 -0
- package/containers/RolesAndPermissions/index.d.ts +19 -0
- package/containers/RolesAndPermissions.d.ts +3 -0
- package/containers/RolesAndPermissions.js +4 -0
- package/containers/RolesAndPermissions.js.map +1 -0
- package/containers/index.d.ts +7 -0
- package/data/models/company-credit-history.d.ts +54 -0
- package/data/models/company-credit-info.d.ts +33 -0
- package/data/models/company-role.d.ts +48 -0
- package/data/models/company-structure.d.ts +26 -0
- package/data/models/company-team.d.ts +24 -0
- package/data/models/company-user.d.ts +33 -0
- package/data/models/company.d.ts +58 -17
- package/data/models/customer-company-info.d.ts +23 -0
- package/data/models/index.d.ts +7 -0
- package/data/transforms/company.d.ts +5 -0
- package/data/transforms/index.d.ts +8 -0
- package/data/transforms/transform-company-credit-history.d.ts +5 -0
- package/data/transforms/transform-company-credit.d.ts +5 -0
- package/data/transforms/transform-company-roles.d.ts +15 -0
- package/data/transforms/transform-company-structure.d.ts +22 -0
- package/data/transforms/transform-company-team.d.ts +10 -0
- package/data/transforms/transform-company-user.d.ts +18 -0
- package/data/transforms/transform-company.d.ts +5 -1
- package/data/transforms/transform-customer-company-info.d.ts +10 -0
- package/data/transforms/transform-store-config.d.ts +4 -0
- package/hooks/containers/index.d.ts +3 -0
- package/hooks/containers/useCompanyCreditHistory.d.ts +32 -0
- package/hooks/containers/useCompanyProfile.d.ts +2 -8
- package/hooks/containers/useCompanyUsers.d.ts +34 -0
- package/hooks/containers/useCustomerCompanyInfo.d.ts +12 -0
- package/hooks/index.d.ts +9 -0
- package/hooks/useCompanyContextListener.d.ts +62 -0
- package/hooks/useCompanyRegistrationForm.d.ts +37 -0
- package/hooks/useCompanyRoles.d.ts +28 -0
- package/hooks/useCompanyStructureCard.d.ts +36 -0
- package/hooks/useCompanyTeamForm.d.ts +30 -0
- package/hooks/useCompanyUserForm.d.ts +37 -0
- package/hooks/useCountryAndRegionFields.d.ts +20 -0
- package/hooks/useModal.d.ts +24 -0
- package/hooks/usePermissions.d.ts +31 -0
- package/hooks/useUserPermissions.d.ts +26 -0
- package/i18n/en_US.json.d.ts +345 -4
- package/lib/acdl.d.ts +2 -1
- package/lib/company-permissions.d.ts +25 -0
- package/lib/encoding.d.ts +43 -0
- package/lib/fetch-error.d.ts +6 -1
- package/lib/index.d.ts +3 -0
- package/lib/network-error.d.ts +4 -0
- package/lib/userHelpers.d.ts +47 -0
- package/lib/validationFields.d.ts +16 -0
- package/package.json +1 -1
- package/render.js +12 -2
- package/render.js.map +1 -1
- package/types/api/{checkIsCompanyEnabled.types.d.ts → checkCompanyCreditEnabled.types.d.ts} +3 -3
- package/types/api/companyRoles.types.d.ts +137 -0
- package/types/api/companyUsers.types.d.ts +70 -0
- package/types/api/createCompanyTeam.types.d.ts +27 -0
- package/types/api/createCompanyUser.types.d.ts +31 -0
- package/types/api/deleteCompanyTeam.types.d.ts +20 -0
- package/types/api/deleteCompanyUser.types.d.ts +28 -0
- package/types/api/fetchUserPermissions.types.d.ts +43 -0
- package/types/api/getCompany.types.d.ts +1 -1
- package/types/api/getCompanyCredit.types.d.ts +40 -0
- package/types/api/getCompanyCreditHistory.types.d.ts +61 -0
- package/types/api/getCompanyCreditHistoryParams.types.d.ts +53 -0
- package/types/api/getCompanyStructure.types.d.ts +33 -0
- package/types/api/getCompanyTeam.types.d.ts +20 -0
- package/types/api/getCompanyUser.types.d.ts +20 -0
- package/types/api/getCustomerCompanyInfo.types.d.ts +40 -0
- package/types/api/getStoreConfig.types.d.ts +33 -0
- package/types/api/index.d.ts +29 -0
- package/types/api/initialize.types.d.ts +21 -0
- package/types/api/isCompanyUserEmailAvailable.types.d.ts +20 -0
- package/types/api/updateCompany.types.d.ts +1 -1
- package/types/api/updateCompanyStructure.types.d.ts +21 -0
- package/types/api/updateCompanyTeam.types.d.ts +22 -0
- package/types/api/updateCompanyUser.types.d.ts +27 -0
- package/types/api/updateCompanyUserStatus.types.d.ts +22 -0
- package/types/companyForm.types.d.ts +33 -0
- package/types/companyPermission.types.d.ts +33 -0
- package/types/companyProfile.types.d.ts +43 -0
- package/types/companyStructure.types.d.ts +28 -0
- package/types/customerCompanyInfo.types.d.ts +11 -0
- package/types/events.d.ts +21 -0
- package/types/form.types.d.ts +93 -0
- package/types/hook.types.d.ts +18 -0
- package/types/index.d.ts +25 -2
- package/api/checkIsCompanyEnabled/checkIsCompanyEnabled.d.ts +0 -4
- package/api/updateCompany/graphql/updateCompany.graphql.d.ts +0 -2
- package/chunks/getCountries.js +0 -135
- package/chunks/getCountries.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tree.js","sources":["../../node_modules/mobile-drag-drop/index.min.js","/@dropins/storefront-company-management/src/components/Tree/Tree.tsx"],"sourcesContent":["/*! mobile-drag-drop 3.0.0-rc.0 | Copyright (c) 2022 Tim Ruffles | MIT License */\n!function(t,i){\"object\"==typeof exports&&\"undefined\"!=typeof module?i(exports):\"function\"==typeof define&&define.amd?define([\"exports\"],i):i(t.MobileDragDrop=t.MobileDragDrop||{})}(this,function(t){\"use strict\";var c=\"dnd-poly-\",s=[\"none\",\"copy\",\"copyLink\",\"copyMove\",\"link\",\"linkMove\",\"move\",\"all\"],f=[\"none\",\"copy\",\"move\",\"link\"];function i(){var t=!1;try{var i=Object.defineProperty({},\"passive\",{get:function(){t=!0}});window.addEventListener(\"test\",null,i)}catch(t){}return t}var e=i();function l(t){return t&&t.tagName}function h(t,i,s){void 0===s&&(s=!0),document.addEventListener(t,i,!!e&&{passive:s})}function n(t,i){document.removeEventListener(t,i)}function u(t,i,s,n){void 0===n&&(n=!1);var h=e?{passive:!0,capture:n}:n;return t.addEventListener(i,s,h),{off:function(){t.removeEventListener(i,s,h)}}}function o(t){return 0===t.length?0:t.reduce(function(t,i){return i+t},0)/t.length}function r(t,i){for(var s=0;s<t.changedTouches.length;s++)if(t.changedTouches[s].identifier===i)return!0;return!1}function a(t,i,s){for(var n=[],h=[],e=0;e<i.touches.length;e++){var r=i.touches[e];n.push(r[t+\"X\"]),h.push(r[t+\"Y\"])}s.x=o(n),s.y=o(h)}var d=[\"\",\"-webkit-\"];function v(t,i,s,n,h){var e=i.x,i=i.y;n&&(e+=n.x,i+=n.y),(h=void 0===h||h)&&(e-=parseInt(t.offsetWidth,10)/2,i-=parseInt(t.offsetHeight,10)/2);for(var r=\"translate3d(\"+e+\"px,\"+i+\"px, 0)\",o=0;o<d.length;o++){var u=d[o]+\"transform\";t.style[u]=r+\" \"+s[o]}}var p=(Object.defineProperty(g.prototype,\"dropEffect\",{get:function(){return this.t},set:function(t){0!==this.i.mode&&-1<s.indexOf(t)&&(this.t=t)},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,\"types\",{get:function(){if(0!==this.i.mode)return Object.freeze(this.i.types)},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,\"effectAllowed\",{get:function(){return this.i.effectAllowed},set:function(t){2===this.i.mode&&-1<s.indexOf(t)&&(this.i.effectAllowed=t)},enumerable:!1,configurable:!0}),g.prototype.setData=function(t,i){if(2===this.i.mode){if(-1<t.indexOf(\" \"))throw new Error(\"illegal arg: type contains space\");this.i.data[t]=i,-1===this.i.types.indexOf(t)&&this.i.types.push(t)}},g.prototype.getData=function(t){if(1===this.i.mode||2===this.i.mode)return this.i.data[t]||\"\"},g.prototype.clearData=function(t){2===this.i.mode&&(t&&this.i.data[t]?(delete this.i.data[t],-1<(t=this.i.types.indexOf(t))&&this.i.types.splice(t,1)):(this.i.data={},this.i.types=[]))},g.prototype.setDragImage=function(t,i,s){2===this.i.mode&&this.h(t,i,s)},g);function g(t,i){this.i=t,this.h=i,this.t=f[0]}function m(t,i){return t?t===s[0]?f[0]:0===t.indexOf(s[1])||t===s[7]?f[1]:0===t.indexOf(s[4])?f[3]:t===s[6]?f[2]:f[1]:3===i.nodeType&&\"A\"===i.tagName?f[3]:f[1]}function y(u,t,a,i,s,n,c){void 0===c&&(c=null);s=function(t,i,s,n,h,e,r){void 0===c&&(r=null);var o=a.changedTouches[0],n=new Event(u,{bubbles:!0,cancelable:n});n.dataTransfer=e,n.relatedTarget=r,n.screenX=o.screenX,n.screenY=o.screenY,n.clientX=o.clientX,n.clientY=o.clientY,n.pageX=o.pageX,n.pageY=o.pageY;t=t.getBoundingClientRect();return n.offsetX=n.clientX-t.left,n.offsetY=n.clientY-t.top,n}(t,0,0,n=void 0===n||n,document.defaultView,s,c),s=!t.dispatchEvent(s);return i.mode=0,s}function b(t,i){if(!t||t===s[7])return i;if(i===f[1]){if(0===t.indexOf(f[1]))return f[1]}else if(i===f[3]){if(0===t.indexOf(f[3])||-1<t.indexOf(\"Link\"))return f[3]}else if(i===f[2]&&(0===t.indexOf(f[2])||-1<t.indexOf(\"Move\")))return f[2];return f[0]}var w=(x.prototype.o=function(){var n=this;this.u=1,this.l=f[0],this.v={data:{},effectAllowed:void 0,mode:3,types:[]},this.p={x:null,y:null},this.g={x:null,y:null};var h=this.m;if(this.I=new p(this.v,function(t,i,s){h=t,\"number\"!=typeof i&&\"number\"!=typeof s||(n.j={x:i||0,y:s||0})}),this.v.mode=2,this.I.dropEffect=f[0],y(\"dragstart\",this.m,this.k,this.v,this.I))return this.u=3,this.C(),!1;a(\"page\",this.k,this.g);var i,t,s=this.S.dragImageSetup(h);return this.A=(i=s,d.map(function(t){t=i.style[t+\"transform\"];return t&&\"none\"!==t?t.replace(/translate\\(\\D*\\d+[^,]*,\\D*\\d+[^,]*\\)\\s*/g,\"\"):\"\"})),s.style.position=\"absolute\",s.style.left=\"0px\",s.style.top=\"0px\",s.style.zIndex=\"999999\",s.classList.add(\"dnd-poly-drag-image\"),s.classList.add(\"dnd-poly-icon\"),this.O=s,this.j||(this.S.dragImageOffset?this.j={x:this.S.dragImageOffset.x,y:this.S.dragImageOffset.y}:this.S.dragImageCenterOnTouch?(t=getComputedStyle(h),this.j={x:0-parseInt(t.marginLeft,10),y:0-parseInt(t.marginTop,10)}):(s=h.getBoundingClientRect(),t=getComputedStyle(h),this.j={x:s.left-this.M.clientX-parseInt(t.marginLeft,10)+s.width/2,y:s.top-this.M.clientY-parseInt(t.marginTop,10)+s.height/2})),v(this.O,this.g,this.A,this.j,this.S.dragImageCenterOnTouch),document.body.appendChild(this.O),this.D=window.setInterval(function(){n.F||(n.F=!0,n.N(),n.F=!1)},this.S.iterationInterval),!0},x.prototype.C=function(){this.D&&(clearInterval(this.D),this.D=null),n(\"touchmove\",this.P),n(\"touchend\",this.T),n(\"touchcancel\",this.T),this.O&&(this.O.parentNode.removeChild(this.O),this.O=null),this.L(this.S,this.k,this.u)},x.prototype._=function(t){var s=this;if(!1!==r(t,this.M.identifier)){if(this.k=t,0===this.u){var i=void 0;if(this.S.dragStartConditionOverride)try{i=this.S.dragStartConditionOverride(t)}catch(t){i=!1}else i=1===t.touches.length;return i?void(!0===this.o()&&(this.H.preventDefault(),t.preventDefault())):void this.C()}if(t.preventDefault(),a(\"client\",t,this.p),a(\"page\",t,this.g),this.S.dragImageTranslateOverride)try{var n=!1;if(this.S.dragImageTranslateOverride(t,{x:this.p.x,y:this.p.y},this.V,function(t,i){s.O&&(n=!0,s.p.x+=t,s.p.y+=i,s.g.x+=t,s.g.y+=i,v(s.O,s.g,s.A,s.j,s.S.dragImageCenterOnTouch))}),n)return}catch(t){}v(this.O,this.g,this.A,this.j,this.S.dragImageCenterOnTouch)}},x.prototype.X=function(t){if(!1!==r(t,this.M.identifier)){if(this.S.dragImageTranslateOverride)try{this.S.dragImageTranslateOverride(void 0,void 0,void 0,function(){})}catch(t){}0!==this.u?(t.preventDefault(),this.u=\"touchcancel\"===t.type?3:2):this.C()}},x.prototype.N=function(){var t=this,i=this.l;this.v.mode=3,this.I.dropEffect=f[0];var s,n,h,e,r,o=y(\"drag\",this.m,this.k,this.v,this.I);if(o&&(this.l=f[0]),o||2===this.u||3===this.u)return this.Y(this.u)?(e=this.m,s=this.O,n=this.A,a=function(){t.q()},void(\"hidden\"!==(r=getComputedStyle(e)).visibility&&\"none\"!==r.display?(s.classList.add(\"dnd-poly-snapback\"),h=getComputedStyle(s),o=parseFloat(h.transitionDuration),isNaN(o)||0===o?a():((e={x:(u=e.getBoundingClientRect()).left,y:u.top}).x+=document.body.scrollLeft||document.documentElement.scrollLeft,e.y+=document.body.scrollTop||document.documentElement.scrollTop,e.x-=parseInt(r.marginLeft,10),e.y-=parseInt(r.marginTop,10),u=parseFloat(h.transitionDelay),u=Math.round(1e3*(o+u)),v(s,e,n,void 0,!1),setTimeout(a,u))):a())):void this.q();var u=this.S.elementFromPoint(this.p.x,this.p.y),a=this.B;u!==this.V&&u!==this.B&&(this.V=u,null!==this.B&&(this.v.mode=3,this.I.dropEffect=f[0],y(\"dragexit\",this.B,this.k,this.v,this.I,!1)),null===this.V?this.B=this.V:(this.v.mode=3,this.I.dropEffect=m(this.v.effectAllowed,this.m),y(\"dragenter\",this.V,this.k,this.v,this.I)?(this.B=this.V,this.l=b(this.I.effectAllowed,this.I.dropEffect)):this.V!==document.body&&(this.B=document.body))),a!==this.B&&l(a)&&(this.v.mode=3,this.I.dropEffect=f[0],y(\"dragleave\",a,this.k,this.v,this.I,!1,this.B)),l(this.B)&&(this.v.mode=3,this.I.dropEffect=m(this.v.effectAllowed,this.m),!1===y(\"dragover\",this.B,this.k,this.v,this.I)?this.l=f[0]:this.l=b(this.I.effectAllowed,this.I.dropEffect)),i!==this.l&&this.O.classList.remove(c+i);i=c+this.l;this.O.classList.add(i)},x.prototype.Y=function(t){t=this.l===f[0]||null===this.B||3===t;return t?l(this.B)&&(this.v.mode=3,this.I.dropEffect=f[0],y(\"dragleave\",this.B,this.k,this.v,this.I,!1)):l(this.B)&&(this.v.mode=1,this.I.dropEffect=this.l,!0===y(\"drop\",this.B,this.k,this.v,this.I)?this.l=this.I.dropEffect:this.l=f[0]),t},x.prototype.q=function(){this.v.mode=3,this.I.dropEffect=this.l,y(\"dragend\",this.m,this.k,this.v,this.I,!1),this.u=2,this.C()},x);function x(t,i,s,n){this.H=t,this.S=i,this.m=s,this.L=n,this.u=0,this.V=null,this.B=null,this.k=t,this.M=t.changedTouches[0],this.P=this._.bind(this),this.T=this.X.bind(this),h(\"touchmove\",this.P,!1),h(\"touchend\",this.T,!1),h(\"touchcancel\",this.T,!1)}var I,j={iterationInterval:150,tryFindDraggableTarget:function(t){for(var i=0,s=t.composedPath();i<s.length;i++){var n=s[i];do{if(!1!==n.draggable){if(!0===n.draggable)return n;if(n.getAttribute&&\"true\"===n.getAttribute(\"draggable\"))return n}}while((n=n.parentNode)&&n!==document.body)}},dragImageSetup:function(t){var i=t.cloneNode(!0);return function t(i,s){if(1===i.nodeType){for(var n,h,e=getComputedStyle(i),r=0;r<e.length;r++){var o=e[r];s.style.setProperty(o,e.getPropertyValue(o),e.getPropertyPriority(o))}s.style.pointerEvents=\"none\",s.removeAttribute(\"id\"),s.removeAttribute(\"class\"),s.removeAttribute(\"draggable\"),\"CANVAS\"===s.nodeName&&(n=s,h=(h=i).getContext(\"2d\").getImageData(0,0,h.width,h.height),n.getContext(\"2d\").putImageData(h,0,0))}if(i.hasChildNodes())for(r=0;r<i.childNodes.length;r++)t(i.childNodes[r],s.childNodes[r]);!function t(i){if(i instanceof HTMLElement&&(i.style.pointerEvents=\"none\"),i.children&&i.children.length)for(var s=0;s<i.children.length;s++)t(i.children[s]);if(i.shadowRoot&&i.shadowRoot.children.length)for(s=0;s<i.shadowRoot.children.length;s++)t(i.shadowRoot.children[s])}(s)}(t,i),i},elementFromPoint:function(t,i){var s=document.elementFromPoint(t,i);if(s){for(;s.shadowRoot;){var n=s.shadowRoot.elementFromPoint(t,i);if(null===n||n===s)break;s=n}return s}}};function k(i){if(!I){var t=j.tryFindDraggableTarget(i);if(t)try{I=new w(i,j,t,S)}catch(t){throw S(j,i,3),t}}}function C(t){function i(t){h.off(),e.off(),r.off(),o.off(),s&&s.dispatchEvent(new CustomEvent(\"dnd-poly-dragstart-cancel\",{bubbles:!0,cancelable:!0})),clearTimeout(n)}var s=t.target;s&&s.dispatchEvent(new CustomEvent(\"dnd-poly-dragstart-pending\",{bubbles:!0,cancelable:!0}));var n=window.setTimeout(function(){h.off(),e.off(),r.off(),o.off(),k(t)},j.holdToDrag),h=u(s,\"touchend\",i),e=u(s,\"touchcancel\",i),r=u(s,\"touchmove\",i),o=u(window,\"scroll\",i,!0)}function S(t,i,s){if(0===s&&t.defaultActionOverride)try{t.defaultActionOverride(i),i.defaultPrevented}catch(t){}I=null}t.polyfill=function(i){if(i&&Object.keys(i).forEach(function(t){j[t]=i[t]}),!j.forceApply){t=(t=!!window.chrome||/chrome/i.test(navigator.userAgent),{dragEvents:\"ondragstart\"in document.documentElement,draggable:\"draggable\"in document.documentElement,userAgentSupportingNativeDnD:!(/iPad|iPhone|iPod|Android/.test(navigator.userAgent)||t&&\"ontouchstart\"in document.documentElement)});if(t.userAgentSupportingNativeDnD&&t.draggable&&t.dragEvents)return!1}var t;return j.holdToDrag?h(\"touchstart\",C,!1):h(\"touchstart\",k,!1),!0},t.supportsPassiveEventListener=i,Object.defineProperty(t,\"G\",{value:!0})});\n//# sourceMappingURL=index.min.js.map","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FunctionComponent } from 'preact';\nimport { useMemo, useCallback, useRef } from 'preact/hooks';\nimport { Checkbox } from '@adobe-commerce/elsie/components';\nimport { polyfill } from 'mobile-drag-drop';\nimport 'mobile-drag-drop/default.css';\nimport 'mobile-drag-drop/icons.css';\nimport './Tree.css';\n\n// Initialize mobile-drag-drop polyfill once\nlet polyfillInitialized = false;\nif (typeof window !== 'undefined' && !polyfillInitialized) {\n // Required for iOS 10+\n try {\n window.addEventListener('touchmove', () => {}, { passive: false });\n } catch (e) {}\n \n polyfill({\n holdToDrag: 300,\n tryFindDraggableTarget: (event: TouchEvent) => {\n let element = event.target as HTMLElement;\n while (element && element !== document.body) {\n if (element.getAttribute('draggable') === 'true') {\n return element;\n }\n element = element.parentElement as HTMLElement;\n }\n return undefined;\n },\n });\n \n // Required: prevent context menu on long press\n document.addEventListener('contextmenu', (e) => {\n const target = e.target as HTMLElement;\n if (target.closest('[draggable=\"true\"]')) {\n e.preventDefault();\n }\n });\n \n polyfillInitialized = true;\n}\n\nexport interface TreeItem {\n id: string;\n parentId?: string | null;\n label: string;\n}\n\nexport interface RenderNodeArgs {\n item: TreeItem;\n level: number;\n expanded: boolean;\n selected: boolean;\n hasChildren: boolean;\n toggle: () => void;\n select: () => void;\n // Optional Elsie-friendly render helpers\n expander?: () => any;\n checkbox?: () => any;\n icon?: () => any;\n}\n\nexport interface TreeProps {\n items: TreeItem[];\n rootId?: string | null;\n className?: string;\n expandedIds: Set<string>;\n selectedId?: string | null;\n selectedIds?: Set<string>;\n onExpandedChange: (next: Set<string>) => void;\n onSelectedChange?: (id: string | null) => void;\n onSelectedIdsChange?: (ids: Set<string>) => void;\n renderNode: (args: RenderNodeArgs) => any;\n role?: 'tree' | 'list' | 'grid'; // default 'tree'\n // Sorting behavior (optional)\n preserveOrder?: boolean; // If true, preserve the original order of items. If false/undefined, sort alphabetically by label\n // Drag & Drop (optional)\n draggable?: (item: TreeItem) => boolean;\n canDrop?: (dragId: string, targetId: string) => boolean;\n onMove?: (args: { id: string; newParentId: string }) => void;\n // Checkable (optional)\n isCheckable?: (item: TreeItem) => boolean;\n checkedIds?: Set<string>;\n onCheckedChange?: (next: Set<string>) => void;\n // Checkbox behavior (optional)\n biDirectionalChecking?: boolean; // If true, checking a node directly marks it as checked. If false, uses descendant-based logic (default: false)\n // Optional Elsie-friendly render-props to build UI primitives\n renderExpander?: (args: { expanded: boolean; hasChildren: boolean; toggle: () => void }) => any;\n renderCheckbox?: (args: { checked: boolean; indeterminate: boolean; onCheck: () => void }) => any;\n renderIcon?: (args: { item: TreeItem; level: number; hasChildren: boolean; expanded: boolean }) => any;\n}\n\nconst buildChildrenMap = (items: TreeItem[], preserveOrder: boolean = false): Map<string | null, TreeItem[]> => {\n const byParent = new Map<string | null, TreeItem[]>();\n for (const item of items) {\n const key = (item.parentId ?? null) as string | null;\n const list = byParent.get(key) ?? [];\n list.push(item);\n byParent.set(key, list);\n }\n \n // Apply sorting based on preserveOrder flag\n if (!preserveOrder) {\n // Default behavior: stable sort by label for determinism\n for (const [, list] of byParent) {\n list.sort((a, b) => a.label.localeCompare(b.label));\n }\n }\n // If preserveOrder is true, keep the original order (e.g., sorted by sort_order)\n \n return byParent;\n};\n\nexport const Tree: FunctionComponent<TreeProps> = ({\n items,\n rootId = null,\n className,\n expandedIds,\n selectedId = null,\n selectedIds,\n onExpandedChange,\n onSelectedChange,\n onSelectedIdsChange,\n renderNode,\n role = 'tree',\n preserveOrder = false,\n draggable,\n canDrop,\n onMove,\n isCheckable,\n checkedIds,\n onCheckedChange,\n biDirectionalChecking = false,\n renderExpander,\n renderCheckbox,\n renderIcon,\n}) => {\n const byParent = useMemo(() => buildChildrenMap(items, preserveOrder), [items, preserveOrder]);\n const draggingIdRef = useRef<string | null>(null);\n const multiSelectRef = useRef<boolean>(false);\n\n const byId = useMemo(() => new Map(items.map((i) => [i.id, i] as const)), [items]);\n\n const collectDescendants = (\n byParentMap: Map<string | null, TreeItem[]>,\n id: string\n ): string[] => {\n const out: string[] = [];\n const stack = [id];\n while (stack.length) {\n const cur = stack.pop()!;\n const children = byParentMap.get(cur) ?? [];\n for (const ch of children) {\n out.push(ch.id);\n stack.push(ch.id);\n }\n }\n return out;\n };\n\n const getDescendants = useCallback(\n (id: string): string[] => {\n return collectDescendants(byParent, id);\n },\n [byParent]\n );\n\n const isNodeCheckable = useCallback((item: TreeItem) => (isCheckable ? isCheckable(item) : true), [isCheckable]);\n\n const computeCheckedState = useCallback(\n (id: string): { checked: boolean; indeterminate: boolean } => {\n const item = byId.get(id);\n if (!item) return { checked: false, indeterminate: false };\n \n const set = checkedIds ?? new Set<string>();\n \n if (biDirectionalChecking) {\n // If this node is directly checked, show it as checked\n if (set.has(id)) {\n return { checked: true, indeterminate: false };\n }\n \n // Otherwise, check descendants to determine indeterminate state\n const descendants = getDescendants(id).filter((nid) => {\n const node = byId.get(nid);\n return node ? isNodeCheckable(node) : false;\n });\n \n if (descendants.length === 0) return { checked: false, indeterminate: false };\n \n const numCheckedDescendants = descendants.reduce((acc, nid) => (set.has(nid) ? acc + 1 : acc), 0);\n \n if (numCheckedDescendants === 0) return { checked: false, indeterminate: false };\n return { checked: false, indeterminate: true };\n }\n \n // Check if node and ALL descendants are checked\n const all = [id, ...getDescendants(id)].filter((nid) => {\n const node = byId.get(nid);\n return node ? isNodeCheckable(node) : false;\n });\n \n if (all.length === 0) return { checked: false, indeterminate: false };\n \n const numChecked = all.reduce((acc, nid) => (set.has(nid) ? acc + 1 : acc), 0);\n \n if (numChecked === 0) return { checked: false, indeterminate: false };\n if (numChecked === all.length) return { checked: true, indeterminate: false };\n return { checked: false, indeterminate: true };\n },\n [byId, getDescendants, isNodeCheckable, checkedIds, biDirectionalChecking]\n );\n\n const toggleCheck = useCallback(\n (id: string) => {\n if (!onCheckedChange) return;\n \n const set = new Set(checkedIds ?? []);\n const { checked } = computeCheckedState(id);\n \n // 1) Handle downward propagation: check/uncheck this node and all descendants\n const descendants = getDescendants(id);\n const targets = [id, ...descendants].filter((nid) => {\n const node = byId.get(nid);\n return node ? isNodeCheckable(node) : false;\n });\n \n if (checked) {\n // Unchecking: remove this node and all descendants\n for (const nid of targets) set.delete(nid);\n } else {\n // Checking: add this node and all descendants\n for (const nid of targets) set.add(nid);\n }\n \n // 2) Handle upward propagation: only check ancestors when checking\n if (biDirectionalChecking && !checked) {\n const item = byId.get(id);\n if (item) {\n let currentParentId = item.parentId;\n while (currentParentId) {\n const parentItem = byId.get(currentParentId);\n if (!parentItem || !isNodeCheckable(parentItem)) break;\n \n // When checking a child, check the parent\n set.add(currentParentId);\n \n // Move up to the next parent\n currentParentId = parentItem.parentId;\n }\n }\n }\n \n onCheckedChange(set);\n },\n [checkedIds, onCheckedChange, computeCheckedState, getDescendants, byId, isNodeCheckable, biDirectionalChecking]\n );\n\n // Default checkbox renderer that handles tri-state logic\n const defaultCheckboxRenderer = useCallback(\n (args: { checked: boolean; indeterminate: boolean; onCheck: () => void }) => {\n return (\n <Checkbox\n name={`tree-checkbox-${Math.random().toString(36).substr(2, 9)}`}\n checked={args.checked}\n indeterminate={args.indeterminate}\n onChange={args.onCheck}\n />\n );\n },\n []\n );\n\n const toggle = useCallback(\n (id: string) => {\n const next = new Set(expandedIds);\n if (next.has(id)) next.delete(id);\n else next.add(id);\n onExpandedChange(next);\n },\n [expandedIds, onExpandedChange]\n );\n\n const select = useCallback(\n (id: string) => {\n // If the node is checkable, toggle its checkbox state\n const item = byId.get(id);\n if (item && isNodeCheckable(item) && onCheckedChange) {\n toggleCheck(id);\n }\n\n if (!onSelectedIdsChange) {\n onSelectedChange?.(id);\n return;\n }\n\n const isMulti = !!multiSelectRef.current;\n const next = isMulti ? new Set(selectedIds ?? []) : new Set<string>();\n \n if (isMulti && next.has(id)) {\n next.delete(id);\n } else {\n next.add(id);\n }\n \n onSelectedIdsChange(next);\n multiSelectRef.current = false;\n },\n [onSelectedChange, onSelectedIdsChange, selectedIds, byId, isNodeCheckable, onCheckedChange, toggleCheck]\n );\n\n const renderSubtree = (parentId: string | null, level: number): any => {\n const children = byParent.get(parentId) ?? [];\n if (!children.length) return null;\n const ulClass = level === 1 ? (className ?? 'acm-tree') : 'acm-tree__group';\n return (\n <ul role={level === 1 ? (role as any) : 'group'} className={ulClass}>\n {children.map((item, index) => {\n const childHasChildren = (byParent.get(item.id) ?? []).length > 0;\n const isExpanded = expandedIds.has(item.id);\n const isSelected = (selectedIds ? selectedIds.has(item.id) : (selectedId === item.id));\n const isDraggable = !!draggable?.(item);\n const allowDrop = (dragId: string) => (canDrop ? canDrop(dragId, item.id) : dragId !== item.id);\n // Optional helpers for Elsie-based UIs\n const expanderFactory = childHasChildren\n ? () => (renderExpander ? renderExpander({ expanded: isExpanded, hasChildren: childHasChildren, toggle: () => toggle(item.id) }) : null)\n : undefined;\n const checkboxFactory = (() => {\n if (!onCheckedChange) return undefined;\n const nodeObj = byId.get(item.id);\n if (!nodeObj || !isNodeCheckable(nodeObj)) return undefined;\n const s = computeCheckedState(item.id);\n const checkboxRenderer = renderCheckbox || defaultCheckboxRenderer;\n return () => checkboxRenderer({ checked: s.checked, indeterminate: s.indeterminate, onCheck: () => toggleCheck(item.id) });\n })();\n const iconFactory = renderIcon\n ? () => renderIcon({ item, level, hasChildren: childHasChildren, expanded: isExpanded })\n : undefined;\n\n const node = renderNode({\n item,\n level,\n expanded: isExpanded,\n selected: !!isSelected,\n hasChildren: childHasChildren,\n toggle: () => toggle(item.id),\n select: () => select(item.id),\n ...(expanderFactory ? { expander: expanderFactory } : {}),\n ...(checkboxFactory ? { checkbox: checkboxFactory } : {}),\n ...(iconFactory ? { icon: iconFactory } : {}),\n });\n return (\n <li\n key={item.id}\n role=\"treeitem\"\n className=\"acm-tree__item\"\n data-level={level}\n aria-expanded={childHasChildren ? isExpanded : undefined}\n aria-selected={isSelected || undefined}\n aria-level={level as any}\n aria-setsize={children.length as any}\n aria-posinset={(index + 1) as any}\n draggable={isDraggable}\n onMouseDown={(e) => {\n // Command (mac) or Ctrl (win/linux) enables multi-select\n multiSelectRef.current = !!(e.metaKey || e.ctrlKey);\n }}\n onDragStart={(e) => {\n e.stopPropagation();\n if (!isDraggable) return;\n draggingIdRef.current = item.id;\n try { e.dataTransfer?.setData('text/plain', item.id); } catch {}\n }}\n onDragEnter={(e) => {\n // Required by mobile-drag-drop polyfill\n e.preventDefault();\n }}\n onDragOver={(e) => {\n e.stopPropagation();\n const dragId = draggingIdRef.current ?? (e.dataTransfer?.getData('text/plain') || '');\n if (dragId && allowDrop(dragId)) {\n e.preventDefault();\n }\n }}\n onDrop={(e) => {\n e.stopPropagation();\n const dragId = draggingIdRef.current ?? (e.dataTransfer?.getData('text/plain') || '');\n draggingIdRef.current = null;\n if (dragId && allowDrop(dragId)) {\n onMove?.({ id: dragId, newParentId: item.id });\n }\n }}\n >\n {node}\n {childHasChildren && isExpanded ? renderSubtree(item.id, level + 1) : null}\n </li>\n );\n })}\n </ul>\n );\n };\n\n return <div className=\"acm-tree-root\">{renderSubtree(rootId, 1)}</div>;\n};\n\nexport default Tree;\n"],"names":["t","i","exports","this","c","s","f","e","l","h","n","u","o","r","a","d","v","p","g","m","y","b","w","x","I","j","k","S","C","polyfillInitialized","polyfill","event","element","buildChildrenMap","items","preserveOrder","byParent","item","key","list","Tree","rootId","className","expandedIds","selectedId","selectedIds","onExpandedChange","onSelectedChange","onSelectedIdsChange","renderNode","role","draggable","canDrop","onMove","isCheckable","checkedIds","onCheckedChange","biDirectionalChecking","renderExpander","renderCheckbox","renderIcon","useMemo","draggingIdRef","useRef","multiSelectRef","byId","collectDescendants","byParentMap","id","out","stack","cur","children","ch","getDescendants","useCallback","isNodeCheckable","computeCheckedState","set","descendants","nid","node","acc","all","numChecked","toggleCheck","checked","targets","currentParentId","parentItem","defaultCheckboxRenderer","args","jsx","Checkbox","toggle","next","select","isMulti","renderSubtree","parentId","level","index","childHasChildren","isExpanded","isSelected","isDraggable","allowDrop","dragId","expanderFactory","checkboxFactory","nodeObj","checkboxRenderer","iconFactory","jsxs","_a"],"mappings":"ybACC,SAASA,EAAEC,EAAE,CAAsDA,EAAEC,CAAO,CAAsG,GAAEC,GAAK,SAASH,EAAE,CAAc,IAAII,EAAE,YAAYC,EAAE,CAAC,OAAO,OAAO,W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sD,EAAQ,YAAatE,EAAK,KAE7C,EAEC,SAAA,CAAA4C,GACAqB,GAAoBC,EAAaL,EAAc7D,EAAK,GAAI+D,EAAQ,CAAC,EAAI,IAAA,CAAA,EAzCjE/D,EAAK,EAAA,CA4ChB,CAAC,CAAA,CACH,EArF2B,IAuF/B,EAEA,SAAQ,MAAA,CAAI,UAAU,gBAAiB,SAAA6D,EAAczD,EAAQ,CAAC,EAAE,CAClE","x_google_ignoreList":[0]}
|
package/chunks/acdl.js
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/*! Copyright 2025 Adobe
|
|
2
|
+
All Rights Reserved. */
|
|
3
|
+
var o=(t=>(t.EDIT_COMPANY_EVENT="edit-company",t.EDIT_COMPANY_STRUCTURE_EVENT="edit-company-structure",t))(o||{});const c={EDIT_COMPANY_EVENT:"edit-company",EDIT_COMPANY_STRUCTURE_EVENT:"edit-company-structure"},u=()=>(window.adobeDataLayer||(window.adobeDataLayer=[]),window.adobeDataLayer),r=t=>{u().push(a=>{const n=a.getState?a.getState():{};a.push({event:t,context:n})})},s=(t,e)=>{if(!c[t])return null;switch(t){case"edit-company":r({type:"company",eventType:"edit",companyData:e});break;case"edit-company-structure":r({type:"company-structure",eventType:"edit",structureData:e});break;default:return null}};export{o as E,s as p};
|
|
4
|
+
//# sourceMappingURL=acdl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acdl.js","sources":["/@dropins/storefront-company-management/src/lib/acdl.ts"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\ndeclare global {\n interface Window {\n adobeDataLayer: any[];\n }\n}\n\nenum EventsList {\n EDIT_COMPANY_EVENT = 'edit-company',\n EDIT_COMPANY_STRUCTURE_EVENT = 'edit-company-structure',\n}\n\nconst EVENTS_MAPPING = {\n EDIT_COMPANY_EVENT: EventsList.EDIT_COMPANY_EVENT,\n EDIT_COMPANY_STRUCTURE_EVENT: EventsList.EDIT_COMPANY_STRUCTURE_EVENT,\n};\n\n/**\n * Set and return the Adobe Client Data Layer (ACDL)\n * @returns ACDL instance or an empty array if it doesn't exist\n */\nconst getAdobeDataLayer = () => {\n if (!window.adobeDataLayer) {\n window.adobeDataLayer = [];\n }\n return window.adobeDataLayer;\n};\n\n/**\n * Sets a context in the Adobe Client Data Layer (ACDL)\n * @param context - The context object to set\n */\nconst setContext = (context: Record<string, any>) => {\n const adobeDataLayer = getAdobeDataLayer();\n adobeDataLayer.push({\n context,\n });\n};\n\n/**\n * Pushes an event to the Adobe Client Data Layer (ACDL)\n * @param event - The event object to push\n */\nconst pushEvent = (event: Record<string, any>) => {\n const adobeDataLayer = getAdobeDataLayer();\n \n adobeDataLayer.push((acdl: any) => {\n const state = acdl.getState ? acdl.getState() : {};\n \n acdl.push({\n event,\n context: state,\n });\n });\n};\n\n/**\n * Publishes events to the Adobe Client Data Layer (ACDL)\n * @param eventType - The type of event to publish\n * @param eventParams - Parameters associated with the event\n * @returns null if the event type is not recognized\n */\nconst publishEvents = (eventType: string, eventParams: any) => {\n if (!EVENTS_MAPPING[eventType as keyof typeof EVENTS_MAPPING]) {\n return null;\n }\n\n switch (eventType) {\n case EventsList.EDIT_COMPANY_EVENT:\n pushEvent({\n type: 'company',\n eventType: 'edit',\n companyData: eventParams,\n });\n break;\n case EventsList.EDIT_COMPANY_STRUCTURE_EVENT:\n pushEvent({\n type: 'company-structure',\n eventType: 'edit',\n structureData: eventParams,\n });\n break;\n default:\n return null;\n }\n};\n\nexport { EventsList, publishEvents, pushEvent, setContext };"],"names":["EventsList","EVENTS_MAPPING","getAdobeDataLayer","pushEvent","event","acdl","state","publishEvents","eventType","eventParams"],"mappings":"AAsBA,IAAKA,GAAAA,IACHA,EAAA,mBAAqB,eACrBA,EAAA,6BAA+B,yBAF5BA,IAAAA,GAAA,CAAA,CAAA,EAKL,MAAMC,EAAiB,CACrB,mBAAoB,eACpB,6BAA8B,wBAChC,EAMMC,EAAoB,KACnB,OAAO,iBACV,OAAO,eAAiB,CAAA,GAEnB,OAAO,gBAkBVC,EAAaC,GAA+B,CACzBF,EAAA,EAER,KAAMG,GAAc,CACjC,MAAMC,EAAQD,EAAK,SAAWA,EAAK,SAAA,EAAa,CAAA,EAEhDA,EAAK,KAAK,CACR,MAAAD,EACA,QAASE,CAAA,CACV,CACH,CAAC,CACH,EAQMC,EAAgB,CAACC,EAAmBC,IAAqB,CAC7D,GAAI,CAACR,EAAeO,CAAwC,EAC1D,OAAO,KAGT,OAAQA,EAAA,CACN,IAAK,eACHL,EAAU,CACR,KAAM,UACN,UAAW,OACX,YAAaM,CAAA,CACd,EACD,MACF,IAAK,yBACHN,EAAU,CACR,KAAM,oBACN,UAAW,OACX,cAAeM,CAAA,CAChB,EACD,MACF,QACE,OAAO,IAAA,CAEb"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/*! Copyright 2025 Adobe
|
|
2
|
+
All Rights Reserved. */
|
|
3
|
+
const i=(n=[])=>{const t=new Set,a=[...n];for(;a.length;){const s=a.pop();if(s&&(typeof s.id=="string"&&t.add(s.id),Array.isArray(s.children)&&s.children.length))for(const o of s.children)a.push(o)}return t},c=(n=[])=>Array.from(i(n)),e=n=>(n==null?void 0:n.id)==="0"||typeof(n==null?void 0:n.id)=="number"&&(n==null?void 0:n.id)===0||(n==null?void 0:n.id)==="MA=="||(n==null?void 0:n.name)==="Company Administrator",d=()=>["Magento_Company::view_account","Magento_Company::edit_account","Magento_Company::view_address","Magento_Company::edit_address","Magento_Company::contacts","Magento_Company::payment_information","Magento_Company::shipping_information","Magento_Company::users_view","Magento_Company::users_edit","Magento_Company::roles_view","Magento_Company::roles_edit"],m=n=>{const t=i((n==null?void 0:n.permissions)||[]),a=e(n);return{canViewAccount:a||t.has("Magento_Company::view_account"),canEditAccount:a||t.has("Magento_Company::edit_account"),canViewAddress:a||t.has("Magento_Company::view_address"),canEditAddress:a||t.has("Magento_Company::edit_address"),canViewContacts:a||t.has("Magento_Company::contacts"),canViewPaymentInformation:a||t.has("Magento_Company::payment_information"),canViewShippingInformation:a||t.has("Magento_Company::shipping_information"),canViewUsers:a||t.has("Magento_Company::users_view"),canEditUsers:a||t.has("Magento_Company::users_edit"),canViewRoles:a||t.has("Magento_Company::roles_view"),canManageRoles:a||t.has("Magento_Company::roles_edit")}};export{i as a,m as b,c as f,d as g,e as i};
|
|
4
|
+
//# sourceMappingURL=company-permissions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"company-permissions.js","sources":["/@dropins/storefront-company-management/src/lib/company-permissions.ts"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { CompanyPermissionFlags } from '../types/companyPermission.types';\n\n/**\n * Flattens a nested permissions tree into a Set of permission IDs\n * This is a pure utility function that can be used across the application\n */\nexport const flattenIds = (nodes: any[] = []): Set<string> => {\n const set = new Set<string>();\n const stack = [...nodes];\n while (stack.length) {\n const node = stack.pop();\n if (!node) continue;\n if (typeof node.id === 'string') set.add(node.id);\n if (Array.isArray(node.children) && node.children.length) {\n for (const child of node.children) stack.push(child);\n }\n }\n return set;\n};\n\n/**\n * Flattens a nested permissions tree into an Array of permission IDs\n * Convenience function that returns an array instead of a Set\n */\nexport const flattenIdsToArray = (nodes: any[] = []): string[] => {\n return Array.from(flattenIds(nodes));\n};\n\n/**\n * Determines if a role is a Company Administrator\n */\nexport const isCompanyAdministrator = (role: any): boolean => {\n return role?.id === '0' || \n (typeof role?.id === 'number' && role?.id === 0) || \n role?.id === 'MA==' ||\n role?.name === 'Company Administrator';\n};\n\n/**\n * Returns the list of permissions that Company Administrators have by default\n */\nexport const getAdminPermissions = (): string[] => [\n 'Magento_Company::view_account',\n 'Magento_Company::edit_account',\n 'Magento_Company::view_address',\n 'Magento_Company::edit_address',\n 'Magento_Company::contacts',\n 'Magento_Company::payment_information',\n 'Magento_Company::shipping_information',\n 'Magento_Company::users_view',\n 'Magento_Company::users_edit',\n 'Magento_Company::roles_view',\n 'Magento_Company::roles_edit',\n];\n\n/**\n * Builds permission flags from role data\n */\nexport const buildPermissionFlags = (role: any): CompanyPermissionFlags => {\n const allowedIds = flattenIds(role?.permissions || []);\n const isAdmin = isCompanyAdministrator(role);\n\n return {\n canViewAccount: isAdmin || allowedIds.has('Magento_Company::view_account'),\n canEditAccount: isAdmin || allowedIds.has('Magento_Company::edit_account'),\n canViewAddress: isAdmin || allowedIds.has('Magento_Company::view_address'),\n canEditAddress: isAdmin || allowedIds.has('Magento_Company::edit_address'),\n canViewContacts: isAdmin || allowedIds.has('Magento_Company::contacts'),\n canViewPaymentInformation: isAdmin || allowedIds.has('Magento_Company::payment_information'),\n canViewShippingInformation: isAdmin || allowedIds.has('Magento_Company::shipping_information'),\n canViewUsers: isAdmin || allowedIds.has('Magento_Company::users_view'),\n canEditUsers: isAdmin || allowedIds.has('Magento_Company::users_edit'),\n canViewRoles: isAdmin || allowedIds.has('Magento_Company::roles_view'),\n canManageRoles: isAdmin || allowedIds.has('Magento_Company::roles_edit'),\n };\n};\n\n"],"names":["flattenIds","nodes","set","stack","node","child","flattenIdsToArray","isCompanyAdministrator","role","getAdminPermissions","buildPermissionFlags","allowedIds","isAdmin"],"mappings":"AAuBO,MAAM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BAA6B,EACrE,eAAgBC,GAAWD,EAAW,IAAI,6BAA6B,CAAA,CAE3E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetch-error.js","sources":["/@dropins/storefront-company-management/src/lib/fetch-error.ts"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n/**\n * Handles GraphQL fetch errors by extracting error messages and throwing a new Error\n * \n * @param errors - Array of GraphQL error objects with message property\n * @throws {Error} Combined error message from all GraphQL errors\n */\nexport const handleFetchError = (errors: Array<{ message: string }>) => {\n const errorMessage = errors.map((e) => e.message).join(' ');\n\n throw Error(errorMessage);\n};\n"],"names":["handleFetchError","errors","errorMessage","e"],"mappings":"AAsBO,MAAMA,EAAoBC,GAAuC,CACtE,MAAMC,EAAeD,EAAO,IAAKE,GAAMA,EAAE,OAAO,EAAE,KAAK,GAAG,EAE1D,MAAM,MAAMD,CAAY,CAC1B"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/*! Copyright 2025 Adobe
|
|
2
|
+
All Rights Reserved. */
|
|
3
|
+
import{a as c,i as h,g as m}from"./company-permissions.js";import{h as e}from"./fetch-error.js";import{f as o,h as f}from"./network-error.js";const E=`
|
|
4
|
+
query GET_CUSTOMER_ROLE_PERMISSIONS {
|
|
5
|
+
customer {
|
|
6
|
+
role {
|
|
7
|
+
id
|
|
8
|
+
name
|
|
9
|
+
permissions {
|
|
10
|
+
id
|
|
11
|
+
text
|
|
12
|
+
children {
|
|
13
|
+
id
|
|
14
|
+
text
|
|
15
|
+
children {
|
|
16
|
+
id
|
|
17
|
+
text
|
|
18
|
+
children {
|
|
19
|
+
id
|
|
20
|
+
text
|
|
21
|
+
children {
|
|
22
|
+
id
|
|
23
|
+
text
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
status
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
`;async function O(){return await o(E,{method:"GET",cache:"no-cache"}).then(t=>{var a,d,n;if((a=t.errors)!=null&&a.length)return e(t.errors);const r=(n=(d=t==null?void 0:t.data)==null?void 0:d.customer)==null?void 0:n.role,i=c((r==null?void 0:r.permissions)||[]);return h(r)&&m().forEach(s=>i.add(s)),{allowedIds:i,roleResponse:t}}).catch(f)}export{O as f};
|
|
34
|
+
//# sourceMappingURL=fetchUserPermissions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetchUserPermissions.js","sources":["/@dropins/storefront-company-management/src/api/fetchUserPermissions/graphql/getCustomerRole.graphql.ts","/@dropins/storefront-company-management/src/api/fetchUserPermissions/fetchUserPermissions.ts"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nexport const GET_CUSTOMER_ROLE_PERMISSIONS = /* GraphQL */ `\n query GET_CUSTOMER_ROLE_PERMISSIONS {\n customer {\n role {\n id\n name\n permissions {\n id\n text\n children {\n id\n text\n children {\n id\n text\n children {\n id\n text\n children { \n id \n text \n }\n }\n }\n }\n }\n }\n status\n }\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nimport { fetchGraphQl } from '../fetch-graphql';\nimport { handleNetworkError, handleFetchError, flattenIds, isCompanyAdministrator, getAdminPermissions } from '@/company-management/lib';\nimport { GET_CUSTOMER_ROLE_PERMISSIONS } from './graphql/getCustomerRole.graphql';\nimport type { FetchUserPermissionsResponse, FetchUserPermissionsResult } from '../../types/api/fetchUserPermissions.types';\n\n/**\n * Fetches user permissions and returns both the allowed permission IDs and the role response\n * This is a general-purpose API function that can be used across the application\n * \n * @returns Promise resolving to object containing allowed permission IDs and role response\n * @throws {Error} When network errors or GraphQL errors occur\n */\nexport async function fetchUserPermissions(): Promise<FetchUserPermissionsResult> {\n return await fetchGraphQl(GET_CUSTOMER_ROLE_PERMISSIONS, { \n method: 'GET', \n cache: 'no-cache' \n })\n .then((roleResponse: FetchUserPermissionsResponse) => {\n if (roleResponse.errors?.length) {\n return handleFetchError(roleResponse.errors);\n }\n\n const role = roleResponse?.data?.customer?.role;\n const allowedIds = flattenIds(role?.permissions || []);\n\n const isAdmin = isCompanyAdministrator(role);\n if (isAdmin) {\n getAdminPermissions().forEach((id) => allowedIds.add(id));\n }\n\n return { allowedIds, roleResponse };\n })\n .catch(handleNetworkError);\n}\n"],"names":["GET_CUSTOMER_ROLE_PERMISSIONS","fetchUserPermissions","fetchGraphQl","roleResponse","_a","handleFetchError","role","_c","_b","allowedIds","flattenIds","isCompanyAdministrator","getAdminPermissions","id","handleNetworkError"],"mappings":"8IAgBO,MAAMA,EAA8C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,ECY3D,eAAsBC,GAA4D,CAChF,OAAO,MAAMC,EAAaF,EAA+B,CACvD,OAAQ,MACR,MAAO,UAAA,CACR,EACE,KAAMG,GAA+C,WACpD,IAAIC,EAAAD,EAAa,SAAb,MAAAC,EAAqB,OACvB,OAAOC,EAAiBF,EAAa,MAAM,EAG7C,MAAMG,GAAOC,GAAAC,EAAAL,GAAA,YAAAA,EAAc,OAAd,YAAAK,EAAoB,WAApB,YAAAD,EAA8B,KACrCE,EAAaC,GAAWJ,GAAA,YAAAA,EAAM,cAAe,CAAA,CAAE,EAGrD,OADgBK,EAAuBL,CAAI,GAEzCM,EAAA,EAAsB,QAASC,GAAOJ,EAAW,IAAII,CAAE,CAAC,EAGnD,CAAE,WAAAJ,EAAY,aAAAN,CAAA,CACvB,CAAC,EACA,MAAMW,CAAkB,CAC7B"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/*! Copyright 2025 Adobe
|
|
2
|
+
All Rights Reserved. */
|
|
3
|
+
import{f as R,h as z}from"./network-error.js";const G=c=>{var r,n,l,e,u,d,t,a,_,y,o,g,b,v,f,C,h,p,i,T,E,I,P,D;return{credit:{available_credit:{currency:((e=(l=(n=(r=c==null?void 0:c.data)==null?void 0:r.company)==null?void 0:n.credit)==null?void 0:l.available_credit)==null?void 0:e.currency)||"",value:((a=(t=(d=(u=c==null?void 0:c.data)==null?void 0:u.company)==null?void 0:d.credit)==null?void 0:t.available_credit)==null?void 0:a.value)||0},credit_limit:{currency:((g=(o=(y=(_=c==null?void 0:c.data)==null?void 0:_.company)==null?void 0:y.credit)==null?void 0:o.credit_limit)==null?void 0:g.currency)||"",value:((C=(f=(v=(b=c==null?void 0:c.data)==null?void 0:b.company)==null?void 0:v.credit)==null?void 0:f.credit_limit)==null?void 0:C.value)||0},outstanding_balance:{currency:((T=(i=(p=(h=c==null?void 0:c.data)==null?void 0:h.company)==null?void 0:p.credit)==null?void 0:i.outstanding_balance)==null?void 0:T.currency)||"",value:((D=(P=(I=(E=c==null?void 0:c.data)==null?void 0:E.company)==null?void 0:I.credit)==null?void 0:P.outstanding_balance)==null?void 0:D.value)||0}}}},N=c=>{var n,l,e,u,d,t;const r=(l=(n=c==null?void 0:c.data)==null?void 0:n.company)==null?void 0:l.credit_history;return{items:((e=r==null?void 0:r.items)==null?void 0:e.map(a=>{var _,y,o,g,b,v,f,C,h,p,i,T,E,I,P,D;return{amount:{currency:((_=a==null?void 0:a.amount)==null?void 0:_.currency)||"",value:((y=a==null?void 0:a.amount)==null?void 0:y.value)||0},balance:{availableCredit:{currency:((g=(o=a==null?void 0:a.balance)==null?void 0:o.available_credit)==null?void 0:g.currency)||"",value:((v=(b=a==null?void 0:a.balance)==null?void 0:b.available_credit)==null?void 0:v.value)||0},creditLimit:{currency:((C=(f=a==null?void 0:a.balance)==null?void 0:f.credit_limit)==null?void 0:C.currency)||"",value:((p=(h=a==null?void 0:a.balance)==null?void 0:h.credit_limit)==null?void 0:p.value)||0},outstandingBalance:{currency:((T=(i=a==null?void 0:a.balance)==null?void 0:i.outstanding_balance)==null?void 0:T.currency)||"",value:((I=(E=a==null?void 0:a.balance)==null?void 0:E.outstanding_balance)==null?void 0:I.value)||0}},customReferenceNumber:(a==null?void 0:a.custom_reference_number)||void 0,date:(a==null?void 0:a.date)||"",type:(a==null?void 0:a.type)||"",updatedBy:{name:((P=a==null?void 0:a.updated_by)==null?void 0:P.name)||"",type:((D=a==null?void 0:a.updated_by)==null?void 0:D.type)||""}}}))||[],pageInfo:{currentPage:((u=r==null?void 0:r.page_info)==null?void 0:u.current_page)||1,pageSize:((d=r==null?void 0:r.page_info)==null?void 0:d.page_size)||20,totalPages:((t=r==null?void 0:r.page_info)==null?void 0:t.total_pages)||0},totalCount:(r==null?void 0:r.total_count)||0}},S=`
|
|
4
|
+
query GET_COMPANY_CREDIT
|
|
5
|
+
{
|
|
6
|
+
company {
|
|
7
|
+
credit {
|
|
8
|
+
available_credit {
|
|
9
|
+
currency
|
|
10
|
+
value
|
|
11
|
+
}
|
|
12
|
+
credit_limit {
|
|
13
|
+
currency
|
|
14
|
+
value
|
|
15
|
+
}
|
|
16
|
+
outstanding_balance {
|
|
17
|
+
currency
|
|
18
|
+
value
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
`,$=async()=>await R(S,{method:"GET",cache:"no-cache"}).then(c=>{var n;return(n=c.errors)!=null&&n.length?null:G(c)}).catch(z),O=`
|
|
24
|
+
query GET_COMPANY_CREDIT_HISTORY($filter: CompanyCreditHistoryFilterInput, $pageSize: Int, $currentPage: Int) {
|
|
25
|
+
company {
|
|
26
|
+
credit_history(
|
|
27
|
+
filter: $filter
|
|
28
|
+
pageSize: $pageSize
|
|
29
|
+
currentPage: $currentPage
|
|
30
|
+
) {
|
|
31
|
+
items {
|
|
32
|
+
amount {
|
|
33
|
+
currency
|
|
34
|
+
value
|
|
35
|
+
}
|
|
36
|
+
balance {
|
|
37
|
+
available_credit {
|
|
38
|
+
currency
|
|
39
|
+
value
|
|
40
|
+
}
|
|
41
|
+
credit_limit {
|
|
42
|
+
currency
|
|
43
|
+
value
|
|
44
|
+
}
|
|
45
|
+
outstanding_balance {
|
|
46
|
+
currency
|
|
47
|
+
value
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
custom_reference_number
|
|
51
|
+
date
|
|
52
|
+
type
|
|
53
|
+
updated_by {
|
|
54
|
+
name
|
|
55
|
+
type
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
page_info {
|
|
59
|
+
current_page
|
|
60
|
+
page_size
|
|
61
|
+
total_pages
|
|
62
|
+
}
|
|
63
|
+
total_count
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
`,A=async(c={})=>{const{filter:r,pageSize:n=20,currentPage:l=1}=c,e=r?{custom_reference_number:r.customReferenceNumber,operation_type:r.operationType,updated_by:r.updatedBy}:null;return await R(O,{method:"GET",cache:"no-cache",variables:{filter:e,pageSize:n,currentPage:l}}).then(u=>{var t;return(t=u.errors)!=null&&t.length?null:N(u)}).catch(z)};export{$ as a,A as g};
|
|
68
|
+
//# sourceMappingURL=getCompanyCreditHistory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getCompanyCreditHistory.js","sources":["/@dropins/storefront-company-management/src/data/transforms/transform-company-credit.ts","/@dropins/storefront-company-management/src/data/transforms/transform-company-credit-history.ts","/@dropins/storefront-company-management/src/api/getCompanyCredit/graphql/getCompanyCredit.graphql.ts","/@dropins/storefront-company-management/src/api/getCompanyCredit/getCompanyCredit.ts","/@dropins/storefront-company-management/src/api/getCompanyCreditHistory/graphql/getCompanyCreditHistory.graphql.ts","/@dropins/storefront-company-management/src/api/getCompanyCreditHistory/getCompanyCreditHistory.ts"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { CompanyCreditResponse } from '@/company-management/types/api/getCompanyCredit.types';\nimport { CompanyCreditInfo } from '@/company-management/data/models/company-credit-info';\n\nexport const transformCompanyCredit = (\n response: CompanyCreditResponse\n): CompanyCreditInfo => {\n return {\n credit: {\n available_credit: {\n currency: response?.data?.company?.credit?.available_credit?.currency || '',\n value: response?.data?.company?.credit?.available_credit?.value || 0,\n },\n credit_limit: {\n currency: response?.data?.company?.credit?.credit_limit?.currency || '',\n value: response?.data?.company?.credit?.credit_limit?.value || 0,\n },\n outstanding_balance: {\n currency: response?.data?.company?.credit?.outstanding_balance?.currency || '',\n value: response?.data?.company?.credit?.outstanding_balance?.value || 0,\n },\n },\n };\n};","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { CompanyCreditHistoryResponse } from '@/company-management/types/api/getCompanyCreditHistory.types';\nimport { CompanyCreditHistory } from '@/company-management/data/models/company-credit-history';\n\nexport const transformCompanyCreditHistory = (\n response: CompanyCreditHistoryResponse\n): CompanyCreditHistory => {\n const creditHistory = response?.data?.company?.credit_history;\n\n return {\n items: creditHistory?.items?.map(item => ({\n amount: {\n currency: item?.amount?.currency || '',\n value: item?.amount?.value || 0,\n },\n balance: {\n availableCredit: {\n currency: item?.balance?.available_credit?.currency || '',\n value: item?.balance?.available_credit?.value || 0,\n },\n creditLimit: {\n currency: item?.balance?.credit_limit?.currency || '',\n value: item?.balance?.credit_limit?.value || 0,\n },\n outstandingBalance: {\n currency: item?.balance?.outstanding_balance?.currency || '',\n value: item?.balance?.outstanding_balance?.value || 0,\n },\n },\n customReferenceNumber: item?.custom_reference_number || undefined,\n date: item?.date || '',\n type: item?.type || '',\n updatedBy: {\n name: item?.updated_by?.name || '',\n type: item?.updated_by?.type || '',\n },\n })) || [],\n pageInfo: {\n currentPage: creditHistory?.page_info?.current_page || 1,\n pageSize: creditHistory?.page_info?.page_size || 20,\n totalPages: creditHistory?.page_info?.total_pages || 0,\n },\n totalCount: creditHistory?.total_count || 0,\n };\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const GET_COMPANY_CREDIT = /* GraphQL */ `\n query GET_COMPANY_CREDIT \n {\n company {\n credit {\n available_credit {\n currency\n value\n }\n credit_limit {\n currency\n value\n }\n outstanding_balance {\n currency\n value\n }\n }\n }\n }\n`;","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { GET_COMPANY_CREDIT } from \"./graphql/getCompanyCredit.graphql\";\nimport { CompanyCreditResponse } from '@/company-management/types/api/getCompanyCredit.types';\nimport { transformCompanyCredit } from '@/company-management/data/transforms';\nimport { handleNetworkError } from '@/company-management/lib';\nimport { CompanyCreditInfo } from '@/company-management/data/models';\nimport { fetchGraphQl } from '../fetch-graphql';\n\nexport const getCompanyCredit = async (): Promise<CompanyCreditInfo | null> => {\n\n return await fetchGraphQl(GET_COMPANY_CREDIT, {\n method: 'GET',\n cache: 'no-cache',\n })\n .then((response: CompanyCreditResponse) => {\n if (response.errors?.length) {\n return null;\n }\n\n const transformedData = transformCompanyCredit(response);\n\n return transformedData;\n })\n .catch(handleNetworkError);\n};","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const GET_COMPANY_CREDIT_HISTORY = /* GraphQL */ `\n query GET_COMPANY_CREDIT_HISTORY($filter: CompanyCreditHistoryFilterInput, $pageSize: Int, $currentPage: Int) {\n company {\n credit_history(\n filter: $filter\n pageSize: $pageSize\n currentPage: $currentPage\n ) {\n items {\n amount {\n currency\n value\n }\n balance {\n available_credit {\n currency\n value\n }\n credit_limit {\n currency\n value\n }\n outstanding_balance {\n currency\n value\n }\n }\n custom_reference_number\n date\n type\n updated_by {\n name\n type\n }\n }\n page_info {\n current_page\n page_size\n total_pages\n }\n total_count\n }\n }\n }\n`;","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { GET_COMPANY_CREDIT_HISTORY } from \"./graphql/getCompanyCreditHistory.graphql\";\nimport { CompanyCreditHistoryResponse } from '@/company-management/types/api/getCompanyCreditHistory.types';\nimport { GetCompanyCreditHistoryParams } from '@/company-management/types/api/getCompanyCreditHistoryParams.types';\nimport { transformCompanyCreditHistory } from '@/company-management/data/transforms';\nimport { handleNetworkError } from '@/company-management/lib';\nimport { CompanyCreditHistory } from '@/company-management/data/models';\nimport { fetchGraphQl } from '../fetch-graphql';\n\nexport const getCompanyCreditHistory = async (params: GetCompanyCreditHistoryParams = {}): Promise<CompanyCreditHistory | null> => {\n const { filter, pageSize = 20, currentPage = 1 } = params;\n\n // Transform camelCase filter to snake_case for GraphQL\n const graphqlFilter = filter ? {\n custom_reference_number: filter.customReferenceNumber,\n operation_type: filter.operationType,\n updated_by: filter.updatedBy,\n } : null;\n\n return await fetchGraphQl(GET_COMPANY_CREDIT_HISTORY, {\n method: 'GET',\n cache: 'no-cache',\n variables: {\n filter: graphqlFilter,\n pageSize,\n currentPage,\n },\n })\n .then((response: CompanyCreditHistoryResponse) => {\n if (response.errors?.length) {\n return null;\n }\n\n const transformedData = transformCompanyCreditHistory(response);\n\n return transformedData;\n })\n .catch(handleNetworkError);\n};\n"],"names":["transformCompanyCredit","response","_d","_c","_b","_a","_h","_g","_f","_e","_l","_k","_j","_i","_p","_o","_n","_m","_t","_s","_r","_q","_x","_w","_v","_u","transformCompanyCreditHistory","creditHistory","item","GET_COMPANY_CREDIT","getCompanyCredit","fetchGraphQl","handleNetworkError","GET_COMPANY_CREDIT_HISTORY","getCompanyCreditHistory","params","filter","pageSize","currentPage","graphqlFilter"],"mappings":"8CAoBO,MAAMA,EACXC,GACsB,qDACtB,MAAO,CACL,OAAQ,CACN,iBAAkB,CAChB,WAAUC,GAAAC,GAAAC,GAAAC,EAAAJ,GAAA,YAAAA,EAAU,OAAV,YAAAI,EAAgB,UAAhB,YAAAD,EAAyB,SAAzB,YAAAD,EAAiC,mBAAjC,YAAAD,EAAmD,WAAY,GACzE,QAAOI,GAAAC,GAAAC,GAAAC,EAAAR,GAAA,YAAAA,EAAU,OAAV,YAAAQ,EAAgB,UAAhB,YAAAD,EAAyB,SAAzB,YAAAD,EAAiC,mBAAjC,YAAAD,EAAmD,QAAS,CAAA,EAErE,aAAc,CACZ,WAAUI,GAAAC,GAAAC,GAAAC,EAAAZ,GAAA,YAAAA,EAAU,OAAV,YAAAY,EAAgB,UAAhB,YAAAD,EAAyB,SAAzB,YAAAD,EAAiC,eAAjC,YAAAD,EAA+C,WAAY,GACrE,QAAOI,GAAAC,GAAAC,GAAAC,EAAAhB,GAAA,YAAAA,EAAU,OAAV,YAAAgB,EAAgB,UAAhB,YAAAD,EAAyB,SAAzB,YAAAD,EAAiC,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A;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,ECQ3CC,EAA0B,MAAOC,EAAwC,KAA6C,CACjI,KAAM,CAAE,OAAAC,EAAQ,SAAAC,EAAW,GAAI,YAAAC,EAAc,GAAMH,EAG7CI,EAAgBH,EAAS,CAC7B,wBAAyBA,EAAO,sBAChC,eAAgBA,EAAO,cACvB,WAAYA,EAAO,SAAA,EACjB,KAEJ,OAAO,MAAML,EAAaE,EAA4B,CACpD,OAAQ,MACR,MAAO,WACP,UAAW,CACT,OAAQM,EACR,SAAAF,EACA,YAAAC,CAAA,CACF,CACD,EACE,KAAMrC,GAA2C,OAChD,OAAII,EAAAJ,EAAS,SAAT,MAAAI,EAAiB,OACZ,KAGeqB,EAA8BzB,CAAQ,CAGhE,CAAC,EACA,MAAM+B,CAAkB,CAC7B"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/*! Copyright 2025 Adobe
|
|
2
|
+
All Rights Reserved. */
|
|
3
|
+
import{f as i,h as l}from"./network-error.js";import{h as m}from"./fetch-error.js";const d=`
|
|
4
|
+
query GET_COMPANY_ENABLED {
|
|
5
|
+
storeConfig {
|
|
6
|
+
company_enabled
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
`,h=async()=>{var a,r,t;const o=await i(d,{method:"POST"});if((a=o==null?void 0:o.errors)!=null&&a.length)throw new Error(((r=o.errors[0])==null?void 0:r.message)||"Failed to load store configuration");const n=(t=o==null?void 0:o.data)==null?void 0:t.storeConfig;if(!n)throw new Error("Invalid response: missing storeConfig");return!!n.company_enabled},E=o=>{var t,e,c;const n=(t=o==null?void 0:o.data)==null?void 0:t.customer,a=(e=o==null?void 0:o.data)==null?void 0:e.company;if(!n||!a)return null;const r={companyName:(a==null?void 0:a.name)??"",jobTitle:(n==null?void 0:n.job_title)??"",workPhoneNumber:(n==null?void 0:n.telephone)??"",userRole:((c=n==null?void 0:n.role)==null?void 0:c.name)??""};return r.companyName?r:null},f=`
|
|
10
|
+
query GET_CUSTOMER_COMPANY_INFO {
|
|
11
|
+
customer {
|
|
12
|
+
id
|
|
13
|
+
job_title
|
|
14
|
+
telephone
|
|
15
|
+
role {
|
|
16
|
+
id
|
|
17
|
+
name
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
company {
|
|
21
|
+
id
|
|
22
|
+
name
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
`;async function C(){var o;try{if(!await h())return null;const a=await i(f,{method:"GET",cache:"no-cache"});return(o=a.errors)!=null&&o.length?m(a.errors):E(a)}catch(n){return l(n)}}export{h as c,C as g};
|
|
26
|
+
//# sourceMappingURL=getCustomerCompany.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getCustomerCompany.js","sources":["/@dropins/storefront-company-management/src/api/companyEnabled/graphql/companyEnabled.graphql.ts","/@dropins/storefront-company-management/src/api/companyEnabled/companyEnabled.ts","/@dropins/storefront-company-management/src/data/transforms/transform-customer-company-info.ts","/@dropins/storefront-company-management/src/api/getCustomerCompany/graphql/getCustomerCompanyInfo.graphql.ts","/@dropins/storefront-company-management/src/api/getCustomerCompany/getCustomerCompany.ts"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const GET_COMPANY_ENABLED = /* GraphQL */ `\n query GET_COMPANY_ENABLED {\n storeConfig {\n company_enabled\n }\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n \nimport { fetchGraphQl } from '../fetch-graphql';\nimport { GET_COMPANY_ENABLED } from './graphql/companyEnabled.graphql';\n\nexport const companyEnabled = async (): Promise<boolean> => { \n const response = await fetchGraphQl(GET_COMPANY_ENABLED, { method: 'POST' });\n\n if ((response as any)?.errors?.length) {\n throw new Error((response as any).errors[0]?.message || 'Failed to load store configuration');\n }\n\n const node = (response as any)?.data?.storeConfig;\n if (!node) {\n throw new Error('Invalid response: missing storeConfig');\n }\n\n return Boolean(node.company_enabled);\n}\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nimport { CustomerCompanyInfo } from '../models/customer-company-info';\nimport { GetCustomerCompanyInfoResponse } from '../../types/api/getCustomerCompanyInfo.types';\n\n/**\n * Transforms GraphQL response to CustomerCompanyInfo model\n * @param response - GraphQL response containing customer and company data\n * @returns Transformed customer company info or null if data is incomplete\n */\nexport const transformCustomerCompanyInfo = (response: GetCustomerCompanyInfoResponse): CustomerCompanyInfo | null => {\n const customer = response?.data?.customer;\n const company = response?.data?.company;\n \n if (!customer || !company) {\n return null;\n }\n\n const companyInfo: CustomerCompanyInfo = {\n companyName: company?.name ?? '',\n jobTitle: customer?.job_title ?? '',\n workPhoneNumber: customer?.telephone ?? '',\n userRole: customer?.role?.name ?? '',\n };\n\n // Only return data if we have at least a company name\n return companyInfo.companyName ? companyInfo : null;\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const GET_CUSTOMER_COMPANY_INFO = `\n query GET_CUSTOMER_COMPANY_INFO {\n customer {\n id\n job_title\n telephone\n role {\n id\n name\n }\n }\n company {\n id\n name\n }\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nimport { fetchGraphQl } from '../fetch-graphql';\nimport { companyEnabled } from '../companyEnabled';\nimport { handleNetworkError } from '../../lib/network-error';\nimport { handleFetchError } from '../../lib/fetch-error';\nimport { CustomerCompanyInfo } from '../../data/models';\nimport { GetCustomerCompanyInfoResponse } from '../../types/api/getCustomerCompanyInfo.types';\nimport { transformCustomerCompanyInfo } from '../../data/transforms';\nimport { GET_CUSTOMER_COMPANY_INFO } from './graphql/getCustomerCompanyInfo.graphql';\n\n/**\n * Gets customer company information for display on account information page\n * This is a simplified API that only returns the essential company info needed\n * for the customer account page, without requiring full company permissions\n * \n * @returns Promise resolving to CustomerCompanyInfo or null if company functionality is disabled\n * @throws {Error} When network errors or GraphQL errors occur\n */\nexport async function getCustomerCompany(): Promise<CustomerCompanyInfo | null> {\n try {\n // First check if company functionality is enabled\n const isCompanyEnabled = await companyEnabled();\n if (!isCompanyEnabled) {\n return null;\n }\n\n // Fetch customer company information\n const response: GetCustomerCompanyInfoResponse = await fetchGraphQl(GET_CUSTOMER_COMPANY_INFO, { \n method: 'GET', \n cache: 'no-cache' \n });\n\n if (response.errors?.length) {\n return handleFetchError(response.errors);\n }\n\n // Transform the response using the transformer\n return transformCustomerCompanyInfo(response);\n\n } catch (error) {\n return handleNetworkError(error as Error);\n }\n}\n"],"names":["GET_COMPANY_ENABLED","companyEnabled","response","fetchGraphQl","_a","_b","node","_c","transformCustomerCompanyInfo","customer","company","companyInfo","GET_CUSTOMER_COMPANY_INFO","getCustomerCompany","handleFetchError","error","handleNetworkError"],"mappings":"mFAiBO,MAAMA,EAAoC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,ECGpCC,EAAiB,SAA8B,WAC1D,MAAMC,EAAW,MAAMC,EAAaH,EAAqB,CAAE,OAAQ,OAAQ,EAE3E,IAAKI,EAAAF,GAAA,YAAAA,EAAkB,SAAlB,MAAAE,EAA0B,OAC7B,MAAM,IAAI,QAAOC,EAAAH,EAAiB,OAAO,CAAC,IAAzB,YAAAG,EAA4B,UAAW,oCAAoC,EAG9F,MAAMC,GAAQC,EAAAL,GAAA,YAAAA,EAAkB,OAAlB,YAAAK,EAAwB,YACtC,GAAI,CAACD,EACH,MAAM,IAAI,MAAM,uCAAuC,EAGzD,MAAO,EAAQA,EAAK,eACtB,ECTaE,EAAgCN,GAAyE,WACpH,MAAMO,GAAWL,EAAAF,GAAA,YAAAA,EAAU,OAAV,YAAAE,EAAgB,SAC3BM,GAAUL,EAAAH,GAAA,YAAAA,EAAU,OAAV,YAAAG,EAAgB,QAEhC,GAAI,CAACI,GAAY,CAACC,EAChB,OAAO,KAGT,MAAMC,EAAmC,CACvC,aAAaD,GAAA,YAAAA,EAAS,OAAQ,GAC9B,UAAUD,GAAA,YAAAA,EAAU,YAAa,GACjC,iBAAiBA,GAAA,YAAAA,EAAU,YAAa,GACxC,WAAUF,EAAAE,GAAA,YAAAA,EAAU,OAAV,YAAAF,EAAgB,OAAQ,EAAA,EAIpC,OAAOI,EAAY,YAAcA,EAAc,IACjD,ECxBaC,EAA4B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,ECgBzC,eAAsBC,GAA0D,OAC9E,GAAI,CAGF,GAAI,CADqB,MAAMZ,EAAA,EAE7B,OAAO,KAIT,MAAMC,EAA2C,MAAMC,EAAaS,EAA2B,CAC7F,OAAQ,MACR,MAAO,UAAA,CACR,EAED,OAAIR,EAAAF,EAAS,SAAT,MAAAE,EAAiB,OACZU,EAAiBZ,EAAS,MAAM,EAIlCM,EAA6BN,CAAQ,CAE9C,OAASa,EAAO,CACd,OAAOC,EAAmBD,CAAc,CAC1C,CACF"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/*! Copyright 2025 Adobe
|
|
2
|
+
All Rights Reserved. */
|
|
3
|
+
import{f as a,h as n}from"./network-error.js";import{h as i}from"./fetch-error.js";const s=`
|
|
4
|
+
fragment CompanyRoleFragment on CompanyRole {
|
|
5
|
+
id
|
|
6
|
+
name
|
|
7
|
+
users_count
|
|
8
|
+
permissions {
|
|
9
|
+
id
|
|
10
|
+
text
|
|
11
|
+
sort_order
|
|
12
|
+
children {
|
|
13
|
+
id
|
|
14
|
+
text
|
|
15
|
+
sort_order
|
|
16
|
+
children {
|
|
17
|
+
id
|
|
18
|
+
text
|
|
19
|
+
sort_order
|
|
20
|
+
children {
|
|
21
|
+
id
|
|
22
|
+
text
|
|
23
|
+
sort_order
|
|
24
|
+
children {
|
|
25
|
+
id
|
|
26
|
+
text
|
|
27
|
+
sort_order
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
`,l=`
|
|
35
|
+
query GetCompanyRoles($pageSize: Int, $currentPage: Int) {
|
|
36
|
+
company {
|
|
37
|
+
roles(pageSize: $pageSize, currentPage: $currentPage) {
|
|
38
|
+
items {
|
|
39
|
+
...CompanyRoleFragment
|
|
40
|
+
}
|
|
41
|
+
total_count
|
|
42
|
+
page_info {
|
|
43
|
+
current_page
|
|
44
|
+
page_size
|
|
45
|
+
total_pages
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
${s}
|
|
51
|
+
`,P=`
|
|
52
|
+
query GetCompanyRole($id: ID!) {
|
|
53
|
+
company {
|
|
54
|
+
role(id: $id) {
|
|
55
|
+
...CompanyRoleFragment
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
${s}
|
|
60
|
+
`,d=`
|
|
61
|
+
query GetCompanyAclResources {
|
|
62
|
+
company {
|
|
63
|
+
acl_resources {
|
|
64
|
+
id
|
|
65
|
+
text
|
|
66
|
+
sort_order
|
|
67
|
+
children {
|
|
68
|
+
id
|
|
69
|
+
text
|
|
70
|
+
sort_order
|
|
71
|
+
children {
|
|
72
|
+
id
|
|
73
|
+
text
|
|
74
|
+
sort_order
|
|
75
|
+
children {
|
|
76
|
+
id
|
|
77
|
+
text
|
|
78
|
+
sort_order
|
|
79
|
+
children {
|
|
80
|
+
id
|
|
81
|
+
text
|
|
82
|
+
sort_order
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
`,p=`
|
|
91
|
+
query IsCompanyRoleNameAvailable($name: String!) {
|
|
92
|
+
isCompanyRoleNameAvailable(name: $name) {
|
|
93
|
+
is_role_name_available
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
`,m=e=>{var r;return{id:e.id,text:e.text,sortOrder:e.sort_order,children:(r=e.children)==null?void 0:r.map(m)}},c=e=>({id:e.id,name:e.name,usersCount:e.users_count,permissions:e.permissions.map(m)}),u=e=>({currentPage:e.current_page,pageSize:e.page_size,totalPages:e.total_pages}),y=e=>({items:e.items.map(c),totalCount:e.total_count,pageInfo:u(e.page_info)}),C=e=>{var r,o,t;if((r=e.errors)!=null&&r.length)throw new Error(e.errors[0].message);if(!((t=(o=e.data)==null?void 0:o.company)!=null&&t.roles))throw new Error("Invalid response: missing company roles data");return y(e.data.company.roles)},$=e=>{var r,o,t;if((r=e.errors)!=null&&r.length)throw new Error(e.errors[0].message);if(!((t=(o=e.data)==null?void 0:o.company)!=null&&t.role))throw new Error("Invalid response: missing company role data");return c(e.data.company.role)},R=e=>{var r,o,t;if((r=e.errors)!=null&&r.length)throw new Error(e.errors[0].message);if(!((t=(o=e.data)==null?void 0:o.company)!=null&&t.acl_resources))throw new Error("Invalid response: missing ACL resources data");return e.data.company.acl_resources.map(m)},h=e=>{var r,o,t;if((r=e.errors)!=null&&r.length)throw new Error(e.errors[0].message);if(!((t=(o=e.data)==null?void 0:o.createCompanyRole)!=null&&t.role))throw new Error("Invalid response: missing created role data");return c(e.data.createCompanyRole.role)},_=e=>{var r,o,t;if((r=e.errors)!=null&&r.length)throw new Error(e.errors[0].message);if(!((t=(o=e.data)==null?void 0:o.updateCompanyRole)!=null&&t.role))throw new Error("Invalid response: missing updated role data");return c(e.data.updateCompanyRole.role)},g=e=>({name:e.name,permissions:e.permissions}),E=e=>({id:e.id,name:e.name,permissions:e.permissions}),G=async(e={})=>{try{const r=await a(l,{variables:e,method:"GET",cache:"no-cache"});return C(r)}catch(r){return n(r)}},N=async()=>{try{const e=await a(d,{method:"GET",cache:"force-cache"});return R(e)}catch(e){return n(e)}},f=`
|
|
97
|
+
mutation CreateCompanyRole($input: CompanyRoleCreateInput!) {
|
|
98
|
+
createCompanyRole(input: $input) {
|
|
99
|
+
role {
|
|
100
|
+
...CompanyRoleFragment
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
${s}
|
|
105
|
+
`,w=`
|
|
106
|
+
mutation UpdateCompanyRole($input: CompanyRoleUpdateInput!) {
|
|
107
|
+
updateCompanyRole(input: $input) {
|
|
108
|
+
role {
|
|
109
|
+
...CompanyRoleFragment
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
${s}
|
|
114
|
+
`,A=`
|
|
115
|
+
mutation DeleteCompanyRole($id: ID!) {
|
|
116
|
+
deleteCompanyRole(id: $id) {
|
|
117
|
+
success
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
`,v=async e=>{try{const r={input:g(e)},o=await a(f,{variables:r,method:"POST"});return h(o)}catch(r){return n(r)}},x=async e=>{try{const r={input:E(e)},o=await a(w,{variables:r,method:"POST"});return _(o)}catch(r){return n(r)}},T=async e=>{var r;try{const o=await a(A,{variables:e,method:"POST"});return(r=o.errors)!=null&&r.length?i(o.errors):o.data.deleteCompanyRole.success}catch(o){return n(o)}},L=async e=>{var r;try{const o=await a(p,{variables:e,method:"GET",cache:"no-cache"});return(r=o.errors)!=null&&r.length?i(o.errors):o.data.isCompanyRoleNameAvailable.is_role_name_available}catch(o){return n(o)}};export{P as G,N as a,v as c,T as d,G as g,L as i,$ as t,x as u};
|
|
121
|
+
//# sourceMappingURL=isCompanyRoleNameAvailable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isCompanyRoleNameAvailable.js","sources":["/@dropins/storefront-company-management/src/api/companyRoles/graphql/fragments.ts","/@dropins/storefront-company-management/src/api/companyRoles/graphql/queries.ts","/@dropins/storefront-company-management/src/data/transforms/transform-company-roles.ts","/@dropins/storefront-company-management/src/api/companyRoles/getCompanyRoles.ts","/@dropins/storefront-company-management/src/api/companyRoles/getCompanyAclResources.ts","/@dropins/storefront-company-management/src/api/companyRoles/graphql/mutations.ts","/@dropins/storefront-company-management/src/api/companyRoles/createCompanyRole.ts","/@dropins/storefront-company-management/src/api/companyRoles/updateCompanyRole.ts","/@dropins/storefront-company-management/src/api/companyRoles/deleteCompanyRole.ts","/@dropins/storefront-company-management/src/api/companyRoles/isCompanyRoleNameAvailable.ts"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\n// Fragment for company role data\nexport const COMPANY_ROLE_FRAGMENT = /* GraphQL */ `\n fragment CompanyRoleFragment on CompanyRole {\n id\n name\n users_count\n permissions {\n id\n text\n sort_order\n children {\n id\n text\n sort_order\n children {\n id\n text\n sort_order\n children {\n id\n text\n sort_order\n children {\n id\n text\n sort_order\n }\n }\n }\n }\n }\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { COMPANY_ROLE_FRAGMENT } from './fragments';\n\nexport const GET_COMPANY_ROLES = /* GraphQL */ `\n query GetCompanyRoles($pageSize: Int, $currentPage: Int) {\n company {\n roles(pageSize: $pageSize, currentPage: $currentPage) {\n items {\n ...CompanyRoleFragment\n }\n total_count\n page_info {\n current_page\n page_size\n total_pages\n }\n }\n }\n }\n ${COMPANY_ROLE_FRAGMENT}\n`;\n\nexport const GET_COMPANY_ROLE = /* GraphQL */ `\n query GetCompanyRole($id: ID!) {\n company {\n role(id: $id) {\n ...CompanyRoleFragment\n }\n }\n }\n ${COMPANY_ROLE_FRAGMENT}\n`;\n\nexport const GET_COMPANY_ACL_RESOURCES = /* GraphQL */ `\n query GetCompanyAclResources {\n company {\n acl_resources {\n id\n text\n sort_order\n children {\n id\n text\n sort_order\n children {\n id\n text\n sort_order\n children {\n id\n text\n sort_order\n children {\n id\n text\n sort_order\n }\n }\n }\n }\n }\n }\n }\n`;\n\nexport const IS_COMPANY_ROLE_NAME_AVAILABLE = /* GraphQL */ `\n query IsCompanyRoleNameAvailable($name: String!) {\n isCompanyRoleNameAvailable(name: $name) {\n is_role_name_available\n }\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport {\n CompanyAclResourceResponse,\n CompanyRoleResponse,\n CompanyRolesResponse,\n PageInfoResponse,\n GetCompanyRolesResponse,\n GetCompanyRoleResponse,\n GetCompanyAclResourcesResponse,\n CreateCompanyRoleResponse,\n UpdateCompanyRoleResponse,\n CompanyRoleCreateInput,\n CompanyRoleUpdateInput,\n} from '../../types/api/companyRoles.types';\nimport {\n CompanyAclResourceModel,\n CompanyRoleModel,\n CompanyRolesResponseModel,\n PageInfoModel,\n CompanyRoleCreateInputModel,\n CompanyRoleUpdateInputModel,\n} from '../models/company-role';\n\nexport const transformCompanyAclResource = (\n response: CompanyAclResourceResponse\n): CompanyAclResourceModel => {\n return {\n id: response.id,\n text: response.text,\n sortOrder: response.sort_order,\n children: response.children?.map(transformCompanyAclResource),\n };\n};\n\nexport const transformCompanyRole = (\n response: CompanyRoleResponse\n): CompanyRoleModel => {\n return {\n id: response.id,\n name: response.name,\n usersCount: response.users_count,\n permissions: response.permissions.map(transformCompanyAclResource),\n };\n};\n\nexport const transformPageInfo = (\n response: PageInfoResponse\n): PageInfoModel => {\n return {\n currentPage: response.current_page,\n pageSize: response.page_size,\n totalPages: response.total_pages,\n };\n};\n\nexport const transformCompanyRolesResponse = (\n response: CompanyRolesResponse\n): CompanyRolesResponseModel => {\n return {\n items: response.items.map(transformCompanyRole),\n totalCount: response.total_count,\n pageInfo: transformPageInfo(response.page_info),\n };\n};\n\nexport const transformGetCompanyRolesResponse = (\n response: GetCompanyRolesResponse\n): CompanyRolesResponseModel => {\n if (response.errors?.length) {\n throw new Error(response.errors[0].message);\n }\n \n if (!response.data?.company?.roles) {\n throw new Error('Invalid response: missing company roles data');\n }\n\n return transformCompanyRolesResponse(response.data.company.roles);\n};\n\nexport const transformGetCompanyRoleResponse = (\n response: GetCompanyRoleResponse\n): CompanyRoleModel => {\n if (response.errors?.length) {\n throw new Error(response.errors[0].message);\n }\n \n if (!response.data?.company?.role) {\n throw new Error('Invalid response: missing company role data');\n }\n\n return transformCompanyRole(response.data.company.role);\n};\n\nexport const transformGetCompanyAclResourcesResponse = (\n response: GetCompanyAclResourcesResponse\n): CompanyAclResourceModel[] => {\n if (response.errors?.length) {\n throw new Error(response.errors[0].message);\n }\n \n if (!response.data?.company?.acl_resources) {\n throw new Error('Invalid response: missing ACL resources data');\n }\n\n return response.data.company.acl_resources.map(transformCompanyAclResource);\n};\n\nexport const transformCreateCompanyRoleResponse = (\n response: CreateCompanyRoleResponse\n): CompanyRoleModel => {\n if (response.errors?.length) {\n throw new Error(response.errors[0].message);\n }\n \n if (!response.data?.createCompanyRole?.role) {\n throw new Error('Invalid response: missing created role data');\n }\n\n return transformCompanyRole(response.data.createCompanyRole.role);\n};\n\nexport const transformUpdateCompanyRoleResponse = (\n response: UpdateCompanyRoleResponse\n): CompanyRoleModel => {\n if (response.errors?.length) {\n throw new Error(response.errors[0].message);\n }\n \n if (!response.data?.updateCompanyRole?.role) {\n throw new Error('Invalid response: missing updated role data');\n }\n\n return transformCompanyRole(response.data.updateCompanyRole.role);\n};\n\nexport const transformCompanyRoleCreateInput = (\n input: CompanyRoleCreateInputModel\n): CompanyRoleCreateInput => {\n return {\n name: input.name,\n permissions: input.permissions,\n };\n};\n\nexport const transformCompanyRoleUpdateInput = (\n input: CompanyRoleUpdateInputModel\n): CompanyRoleUpdateInput => {\n return {\n id: input.id,\n name: input.name,\n permissions: input.permissions,\n };\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl } from '../fetch-graphql';\nimport { handleNetworkError } from '../../lib/network-error';\nimport { GET_COMPANY_ROLES } from './graphql/queries';\nimport { GetCompanyRolesVariables, GetCompanyRolesResponse } from '../../types/api/companyRoles.types';\nimport { CompanyRolesResponseModel } from '../../data/models/company-role';\nimport { transformGetCompanyRolesResponse } from '../../data/transforms/transform-company-roles';\n\n/**\n * Fetch all company roles with pagination\n */\nexport const getCompanyRoles = async (\n variables: GetCompanyRolesVariables = {}\n): Promise<CompanyRolesResponseModel> => {\n try {\n const response: GetCompanyRolesResponse = await fetchGraphQl(GET_COMPANY_ROLES, {\n variables,\n method: 'GET',\n cache: 'no-cache',\n });\n\n return transformGetCompanyRolesResponse(response);\n } catch (error) {\n return handleNetworkError(error as Error);\n }\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl } from '../fetch-graphql';\nimport { handleNetworkError } from '../../lib/network-error';\nimport { GET_COMPANY_ACL_RESOURCES } from './graphql/queries';\nimport { GetCompanyAclResourcesResponse } from '../../types/api/companyRoles.types';\nimport { CompanyAclResourceModel } from '../../data/models/company-role';\nimport { transformGetCompanyAclResourcesResponse } from '../../data/transforms/transform-company-roles';\n\n/**\n * Fetch all available ACL resources (permissions)\n */\nexport const getCompanyAclResources = async (): Promise<CompanyAclResourceModel[]> => {\n try {\n const response: GetCompanyAclResourcesResponse = await fetchGraphQl(GET_COMPANY_ACL_RESOURCES, {\n method: 'GET',\n cache: 'force-cache', // ACL resources don't change often, so we can cache them\n });\n\n return transformGetCompanyAclResourcesResponse(response);\n } catch (error) {\n return handleNetworkError(error as Error);\n }\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { COMPANY_ROLE_FRAGMENT } from './fragments';\n\nexport const CREATE_COMPANY_ROLE = /* GraphQL */ `\n mutation CreateCompanyRole($input: CompanyRoleCreateInput!) {\n createCompanyRole(input: $input) {\n role {\n ...CompanyRoleFragment\n }\n }\n }\n ${COMPANY_ROLE_FRAGMENT}\n`;\n\nexport const UPDATE_COMPANY_ROLE = /* GraphQL */ `\n mutation UpdateCompanyRole($input: CompanyRoleUpdateInput!) {\n updateCompanyRole(input: $input) {\n role {\n ...CompanyRoleFragment\n }\n }\n }\n ${COMPANY_ROLE_FRAGMENT}\n`;\n\nexport const DELETE_COMPANY_ROLE = /* GraphQL */ `\n mutation DeleteCompanyRole($id: ID!) {\n deleteCompanyRole(id: $id) {\n success\n }\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl } from '../fetch-graphql';\nimport { handleNetworkError } from '../../lib/network-error';\nimport { CREATE_COMPANY_ROLE } from './graphql/mutations';\nimport { CreateCompanyRoleVariables, CreateCompanyRoleResponse } from '../../types/api/companyRoles.types';\nimport { CompanyRoleModel, CompanyRoleCreateInputModel } from '../../data/models/company-role';\nimport { \n transformCreateCompanyRoleResponse,\n transformCompanyRoleCreateInput \n} from '../../data/transforms/transform-company-roles';\n\n/**\n * Create a new company role\n */\nexport const createCompanyRole = async (\n input: CompanyRoleCreateInputModel\n): Promise<CompanyRoleModel> => {\n try {\n const variables: CreateCompanyRoleVariables = {\n input: transformCompanyRoleCreateInput(input),\n };\n\n const response: CreateCompanyRoleResponse = await fetchGraphQl(CREATE_COMPANY_ROLE, {\n variables,\n method: 'POST',\n });\n\n return transformCreateCompanyRoleResponse(response);\n } catch (error) {\n return handleNetworkError(error as Error);\n }\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl } from '../fetch-graphql';\nimport { handleNetworkError } from '../../lib/network-error';\nimport { UPDATE_COMPANY_ROLE } from './graphql/mutations';\nimport { UpdateCompanyRoleVariables, UpdateCompanyRoleResponse } from '../../types/api/companyRoles.types';\nimport { CompanyRoleModel, CompanyRoleUpdateInputModel } from '../../data/models/company-role';\nimport { \n transformUpdateCompanyRoleResponse,\n transformCompanyRoleUpdateInput \n} from '../../data/transforms/transform-company-roles';\n\n/**\n * Update an existing company role\n */\nexport const updateCompanyRole = async (\n input: CompanyRoleUpdateInputModel\n): Promise<CompanyRoleModel> => {\n try {\n const variables: UpdateCompanyRoleVariables = {\n input: transformCompanyRoleUpdateInput(input),\n };\n\n const response: UpdateCompanyRoleResponse = await fetchGraphQl(UPDATE_COMPANY_ROLE, {\n variables,\n method: 'POST',\n });\n\n return transformUpdateCompanyRoleResponse(response);\n } catch (error) {\n return handleNetworkError(error as Error);\n }\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl } from '../fetch-graphql';\nimport { handleNetworkError } from '../../lib/network-error';\nimport { handleFetchError } from '../../lib/fetch-error';\nimport { DELETE_COMPANY_ROLE } from './graphql/mutations';\nimport { DeleteCompanyRoleVariables, DeleteCompanyRoleResponse } from '../../types/api/companyRoles.types';\n\n/**\n * Delete a company role\n */\nexport const deleteCompanyRole = async (\n variables: DeleteCompanyRoleVariables\n): Promise<boolean> => {\n try {\n const response: DeleteCompanyRoleResponse = await fetchGraphQl(DELETE_COMPANY_ROLE, {\n variables,\n method: 'POST',\n });\n\n if (response.errors?.length) {\n return handleFetchError(response.errors);\n }\n\n return response.data.deleteCompanyRole.success;\n } catch (error) {\n return handleNetworkError(error as Error);\n }\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl } from '../fetch-graphql';\nimport { handleNetworkError } from '../../lib/network-error';\nimport { handleFetchError } from '../../lib/fetch-error';\nimport { IS_COMPANY_ROLE_NAME_AVAILABLE } from './graphql/queries';\nimport { \n IsCompanyRoleNameAvailableVariables, \n IsCompanyRoleNameAvailableResponse \n} from '../../types/api/companyRoles.types';\n\n/**\n * Check if a role name is available\n */\nexport const isCompanyRoleNameAvailable = async (\n variables: IsCompanyRoleNameAvailableVariables\n): Promise<boolean> => {\n try {\n const response: IsCompanyRoleNameAvailableResponse = await fetchGraphQl(\n IS_COMPANY_ROLE_NAME_AVAILABLE,\n {\n variables,\n method: 'GET',\n cache: 'no-cache',\n }\n );\n\n if (response.errors?.length) {\n return handleFetchError(response.errors);\n }\n\n return response.data.isCompanyRoleNameAvailable.is_role_name_available;\n } catch (error) {\n return handleNetworkError(error as Error);\n }\n};\n"],"names":["COMPANY_ROLE_FRAGMENT","GET_COMPANY_ROLES","GET_COMPANY_ROLE","GET_COMPANY_ACL_RESOURCES","IS_COMPANY_ROLE_NAME_AVAILABLE","transformCompanyAclResource","response","_a","transformCompanyRole","transformPageInfo","transformCompanyRolesResponse","transformGetCompanyRolesResponse","_c","_b","transformGetCompanyRoleResponse","transformGetCompanyAclResourcesResponse","transformCreateCompanyRoleResponse","transformUpdateCompanyRoleResponse","transformCompanyRoleCreateInput","input","transformCompanyRoleUpdateInput","getCompanyRoles","variables","fetchGraphQl","error","handleNetworkError","getCompanyAclResources","CREATE_COMPANY_ROLE","UPDATE_COMPANY_ROLE","DELETE_COMPANY_ROLE","createCompanyRole","updateCompanyRole","deleteCompanyRole","handleFetchError","isCompanyRoleNameAvailable"],"mappings":"mFAkBO,MAAMA,EAAsC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,ECCtCC,EAAkC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAgB3CD,CAAqB;AAAA,EAGZE,EAAiC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQ1CF,CAAqB;AAAA,EAGZG,EAA0C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAgC1CC,EAA+C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EC1C/CC,EACXC,GAC4B,OAC5B,MAAO,CACL,GAAIA,EAAS,GACb,KAAMA,EAAS,KACf,UAAWA,EAAS,WACpB,UAAUC,EAAAD,EAAS,WAAT,YAAAC,EAAmB,IAAIF,EAA2B,CAEhE,EAEaG,EACXF,IAEO,CACL,GAAIA,EAAS,GACb,KAAMA,EAAS,KACf,WAAYA,EAAS,YACrB,YAAaA,EAAS,YAAY,IAAID,CAA2B,CAAA,GAIxDI,EACXH,IAEO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GISTRATION {
|
|
5
|
+
storeConfig {
|
|
6
|
+
allow_company_registration
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
`,l=async()=>{var a,n,o;const r=await s(i,{method:"POST"});if((a=r==null?void 0:r.errors)!=null&&a.length)throw new Error(((n=r.errors[0])==null?void 0:n.message)||"Failed to load store configuration");const t=(o=r==null?void 0:r.data)==null?void 0:o.storeConfig;if(!t)throw new Error("Invalid response: missing storeConfig");return!!t.allow_company_registration},c=`
|
|
10
|
+
query GET_CUSTOMER_COMPANIES {
|
|
11
|
+
customer {
|
|
12
|
+
companies(input: {}) {
|
|
13
|
+
items {
|
|
14
|
+
id
|
|
15
|
+
name
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
`,_=async()=>{var r,t,a,n;try{const o=await s(c,{method:"POST"});if((r=o.errors)!=null&&r.length)return!1;const e=((n=(a=(t=o==null?void 0:o.data)==null?void 0:t.customer)==null?void 0:a.companies)==null?void 0:n.items)??[];return Array.isArray(e)&&e.length>0}catch{return!1}};export{l as a,_ as i};
|
|
21
|
+
//# sourceMappingURL=isCompanyUser.js.map
|