@equinor/subsurface-app-management 1.0.0 → 1.0.1

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.
Files changed (104) hide show
  1. package/README.md +3 -4
  2. package/dist/esm/api/core/ApiError.js +1 -0
  3. package/dist/esm/api/core/CancelablePromise.js +1 -0
  4. package/dist/esm/api/core/OpenAPI.js +1 -0
  5. package/dist/esm/api/core/request.js +1 -0
  6. package/dist/esm/api/models/ServiceNowUrgency.js +1 -0
  7. package/dist/esm/api/models/TutorialPosition.js +1 -0
  8. package/dist/esm/api/services/PortalService.js +1 -0
  9. package/dist/esm/api/services/ReleaseNotesService.js +1 -0
  10. package/dist/esm/api/services/TutorialService.js +1 -0
  11. package/dist/esm/components/Feature/Feature.js +1 -0
  12. package/dist/esm/hooks/useFeatureToggling.js +1 -0
  13. package/dist/esm/hooks/useReleaseNotesQuery.js +1 -0
  14. package/dist/esm/hooks/useSignalRMessages.js +1 -0
  15. package/dist/esm/index.js +1 -0
  16. package/dist/esm/node_modules/@equinor/eds-tokens/dist/esm/base/clickbounds.js +1 -0
  17. package/dist/esm/node_modules/@equinor/eds-tokens/dist/esm/base/colors.js +1 -0
  18. package/dist/esm/node_modules/@equinor/eds-tokens/dist/esm/base/elevation.js +1 -0
  19. package/dist/esm/node_modules/@equinor/eds-tokens/dist/esm/base/index.js +1 -0
  20. package/dist/esm/node_modules/@equinor/eds-tokens/dist/esm/base/interactions.js +1 -0
  21. package/dist/esm/node_modules/@equinor/eds-tokens/dist/esm/base/shape.js +1 -0
  22. package/dist/esm/node_modules/@equinor/eds-tokens/dist/esm/base/spacings.js +1 -0
  23. package/dist/esm/node_modules/@equinor/eds-tokens/dist/esm/base/typography.js +1 -0
  24. package/dist/esm/providers/AuthProvider/AuthProvider.js +1 -0
  25. package/dist/esm/providers/AuthProvider/AuthProviderInner.js +1 -0
  26. package/dist/esm/providers/FeatureToggleProvider.js +1 -0
  27. package/dist/esm/providers/TutorialProvider/TutorialDialog.js +1 -0
  28. package/dist/esm/providers/TutorialProvider/TutorialProvider.const.js +1 -0
  29. package/dist/esm/providers/TutorialProvider/TutorialProvider.hooks.js +1 -0
  30. package/dist/esm/providers/TutorialProvider/TutorialProvider.js +1 -0
  31. package/dist/esm/providers/TutorialProvider/TutorialProvider.styles.js +67 -0
  32. package/dist/esm/providers/TutorialProvider/TutorialProvider.utils.js +1 -0
  33. package/dist/esm/providers/TutorialProvider/TutorialProviderInner.js +1 -0
  34. package/dist/esm/providers/TutorialProvider/TutorialStepIndicator.js +25 -0
  35. package/dist/esm/providers/TutorialStepsProvider.js +1 -0
  36. package/dist/esm/types/Environment.js +1 -0
  37. package/dist/esm/types/ReleaseNotes.js +1 -0
  38. package/dist/esm/utils/auth_environment.js +1 -0
  39. package/dist/esm/utils/localStorage.js +1 -0
  40. package/dist/types/api/core/ApiError.d.ts +10 -0
  41. package/dist/types/api/core/ApiRequestOptions.d.ts +13 -0
  42. package/dist/types/api/core/ApiResult.d.ts +7 -0
  43. package/dist/types/api/core/CancelablePromise.d.ts +26 -0
  44. package/dist/types/api/core/OpenAPI.d.ts +32 -0
  45. package/dist/types/api/core/request.d.ts +13 -0
  46. package/dist/types/api/index.d.ts +15 -0
  47. package/dist/types/api/models/AccessRole.d.ts +4 -0
  48. package/dist/types/api/models/Applications.d.ts +17 -0
  49. package/dist/types/api/models/CustomTutorialStep.d.ts +4 -0
  50. package/dist/types/api/models/Feature.d.ts +8 -0
  51. package/dist/types/api/models/FeatureToggleDto.d.ts +5 -0
  52. package/dist/types/api/models/GenericTutorialStep.d.ts +7 -0
  53. package/dist/types/api/models/GraphUser.d.ts +6 -0
  54. package/dist/types/api/models/ReleaseNote.d.ts +9 -0
  55. package/dist/types/api/models/ReleaseNotePatch.d.ts +8 -0
  56. package/dist/types/api/models/ServiceNowIncidentAttachmentResponse.d.ts +7 -0
  57. package/dist/types/api/models/ServiceNowIncidentResponse.d.ts +13 -0
  58. package/dist/types/api/models/ServiceNowUrgency.d.ts +5 -0
  59. package/dist/types/api/models/Tutorial.d.ts +13 -0
  60. package/dist/types/api/models/TutorialPosition.d.ts +7 -0
  61. package/dist/types/api/models/TutorialStepBase.d.ts +4 -0
  62. package/dist/types/api/services/PortalService.d.ts +35 -0
  63. package/dist/types/api/services/ReleaseNotesService.d.ts +28 -0
  64. package/dist/types/api/services/TutorialService.d.ts +12 -0
  65. package/dist/types/components/Feature/Feature.d.ts +9 -0
  66. package/dist/types/components/index.d.ts +1 -0
  67. package/dist/types/hooks/index.d.ts +6 -0
  68. package/dist/types/hooks/useFeatureToggling.d.ts +3 -0
  69. package/dist/types/hooks/useReleaseNotesQuery.d.ts +6 -0
  70. package/dist/types/hooks/useSignalRMessages.d.ts +12 -0
  71. package/dist/types/index.d.ts +5 -0
  72. package/dist/types/providers/AuthProvider/AuthProvider.d.ts +17 -0
  73. package/dist/types/providers/AuthProvider/AuthProviderInner.d.ts +16 -0
  74. package/dist/types/providers/FeatureToggleProvider.d.ts +14 -0
  75. package/dist/types/providers/ReleaseNotesProvider.d.ts +20 -0
  76. package/dist/types/providers/TutorialProvider/TutorialDialog.d.ts +3 -0
  77. package/dist/types/providers/TutorialProvider/TutorialProvider.const.d.ts +7 -0
  78. package/dist/types/providers/TutorialProvider/TutorialProvider.d.ts +30 -0
  79. package/dist/types/providers/TutorialProvider/TutorialProvider.hooks.d.ts +3 -0
  80. package/dist/types/providers/TutorialProvider/TutorialProvider.styles.d.ts +26 -0
  81. package/dist/types/providers/TutorialProvider/TutorialProvider.types.d.ts +11 -0
  82. package/dist/types/providers/TutorialProvider/TutorialProvider.utils.d.ts +3 -0
  83. package/dist/types/providers/TutorialProvider/TutorialProviderInner.d.ts +3 -0
  84. package/dist/types/providers/TutorialProvider/TutorialStepIndicator.d.ts +8 -0
  85. package/dist/types/providers/TutorialStepsProvider.d.ts +13 -0
  86. package/dist/types/providers/index.d.ts +5 -0
  87. package/dist/types/storybook/InfoCard.d.ts +8 -0
  88. package/dist/types/storybook/Links.d.ts +9 -0
  89. package/dist/types/storybook/PropsTable.d.ts +10 -0
  90. package/dist/types/storybook/Stack.d.ts +9 -0
  91. package/dist/types/storybook/Story.d.ts +2 -0
  92. package/dist/types/storybook/index.d.ts +5 -0
  93. package/dist/types/tests/browserMocks.d.ts +24 -0
  94. package/dist/types/tests/setupTests.d.ts +2 -0
  95. package/dist/types/tests/test-utils.d.ts +6 -0
  96. package/dist/types/types/Environment.d.ts +6 -0
  97. package/dist/types/types/ReleaseNotes.d.ts +19 -0
  98. package/dist/types/types/index.d.ts +2 -0
  99. package/dist/types/utils/UtilStory.d.ts +7 -0
  100. package/dist/types/utils/auth_environment.d.ts +47 -0
  101. package/dist/types/utils/index.d.ts +2 -0
  102. package/dist/types/utils/localStorage.d.ts +2 -0
  103. package/dist/types/utils/releaseNotes.d.ts +8 -0
  104. package/package.json +1 -1
package/README.md CHANGED
@@ -1,16 +1,15 @@
1
1
 
2
2
  <img alt="intro-logo" src="https://raw.githubusercontent.com/equinor/amplify-components/main/static/amplify_logo.png" width="300px" />
3
3
 
4
- This package contains components, utils, providers and hooks that are used to communicate with `equinor/sam` developed and used by the amplify team.
4
+ This package contains components, utils, providers and hooks that are used to communicate with `equinor/SubsurfAppManagement` developed by the amplify team.
5
5
 
6
6
 
7
- // TODO: Setup storybook
8
7
  # Quick links
9
- - [Storybook](https://storybook-subsurface-app-management.app.radix.equinor.com/)
8
+ - [Storybook](https://subsurface-management-storybook.app.radix.equinor.com/)
10
9
 
11
10
  # Building and publishing
12
11
 
13
12
  Build and publish is done automatically when code is merged into `main` branch, if the package.json version number is higher.
14
13
 
15
14
  # Latest version
16
- [![main](https://img.shields.io/npm/v/@equinor/amplify-components?color=%23c3f3d2&label=%40equinor%2Famplify-components&logo=npm&)](https://www.npmjs.com/package/@equinor/amplify-components)
15
+ [![main](https://img.shields.io/npm/v/@equinor/subsurface-app-management?color=%23c3f3d2&label=%40equinor%2Fsubsurface-app-management&logo=npm&)](https://www.npmjs.com/package/@equinor/subsurface-app-management)
@@ -0,0 +1 @@
1
+ class t extends Error{url;status;statusText;body;request;constructor(t,s,r){super(r),this.name="ApiError",this.url=s.url,this.status=s.status,this.statusText=s.statusText,this.body=s.body,this.request=t}}export{t as ApiError};
@@ -0,0 +1 @@
1
+ class e extends Error{constructor(e){super(e),this.name="CancelError"}get isCancelled(){return!0}}class s{[Symbol.toStringTag];_isResolved;_isRejected;_isCancelled;_cancelHandlers;_promise;_resolve;_reject;constructor(e){this._isResolved=!1,this._isRejected=!1,this._isCancelled=!1,this._cancelHandlers=[],this._promise=new Promise(((s,t)=>{this._resolve=s,this._reject=t;const i=e=>{this._isResolved||this._isRejected||this._isCancelled||this._cancelHandlers.push(e)};return Object.defineProperty(i,"isResolved",{get:()=>this._isResolved}),Object.defineProperty(i,"isRejected",{get:()=>this._isRejected}),Object.defineProperty(i,"isCancelled",{get:()=>this._isCancelled}),e((e=>{this._isResolved||this._isRejected||this._isCancelled||(this._isResolved=!0,this._resolve?.(e))}),(e=>{this._isResolved||this._isRejected||this._isCancelled||(this._isRejected=!0,this._reject?.(e))}),i)}))}then(e,s){return this._promise.then(e,s)}catch(e){return this._promise.catch(e)}finally(e){return this._promise.finally(e)}cancel(){if(!(this._isResolved||this._isRejected||this._isCancelled)){if(this._isCancelled=!0,this._cancelHandlers.length)try{for(const e of this._cancelHandlers)e()}catch(e){return void console.warn("Cancellation threw an error",e)}this._cancelHandlers.length=0,this._reject?.(new e("Request aborted"))}}get isCancelled(){return this._isCancelled}}export{e as CancelError,s as CancelablePromise};
@@ -0,0 +1 @@
1
+ import{auth as t,environment as o}from"../../utils/auth_environment.js";import{request as i}from"./request.js";import{getLocalStorage as e,updateLocalStorage as r}from"../../utils/localStorage.js";import{jwtDecode as E}from"jwt-decode";const{getToken:n}=t,{getApiUrl:a,getEnvironmentName:l}=o,p=l(import.meta.env.VITE_ENVIRONMENT_NAME),m="localhost"===p?"development":p;class A{static getAmplifyPortalToken(){return i(S,{method:"GET",url:"/api/v1/Token/AmplifyPortal"})}static getAmplifyPortalProductionToken(){return i(S,{method:"GET",url:"/api/v1/Token/AmplifyPortal/Production"})}}const T=t=>{if(0===t.length)return!1;try{return!(t=>{const o=E(t),i=(new Date).getTime()/1e3;return o.exp&&i>o.exp})(t)}catch(t){return!1}},d=async(t,o)=>{const i=e(t,"");if(T(i))return i;const E=await o();return r(t,E),E},c=async()=>d(`amplify-portal-${p}`,A.getAmplifyPortalToken),S={BASE:a(import.meta.env.VITE_API_URL),VERSION:"1.0",WITH_CREDENTIALS:!1,CREDENTIALS:"include",TOKEN:n,USERNAME:void 0,PASSWORD:void 0,HEADERS:void 0,ENCODE_PATH:void 0},u={BASE:`https://api-amplify-portal-${m}.radix.equinor.com`,VERSION:"1.0",WITH_CREDENTIALS:!1,CREDENTIALS:"include",TOKEN:c,USERNAME:void 0,PASSWORD:void 0,HEADERS:void 0,ENCODE_PATH:void 0},N={BASE:"https://api-amplify-portal-production.radix.equinor.com",VERSION:"1.0",WITH_CREDENTIALS:!1,CREDENTIALS:"include",TOKEN:async()=>d("amplify-portal-production",A.getAmplifyPortalProductionToken),USERNAME:void 0,PASSWORD:void 0,HEADERS:void 0,ENCODE_PATH:void 0};export{S as OpenAPI,u as OpenAPI_Portal,N as OpenAPI_Portal_Prod,A as TokenService,c as getPortalToken};
@@ -0,0 +1 @@
1
+ import{ApiError as e}from"./ApiError.js";import{CancelablePromise as t}from"./CancelablePromise.js";const r=e=>null!=e,o=e=>"string"==typeof e,n=e=>o(e)&&""!==e,a=e=>"object"==typeof e&&"string"==typeof e.type&&"function"==typeof e.stream&&"function"==typeof e.arrayBuffer&&"function"==typeof e.constructor&&"string"==typeof e.constructor.name&&/^(Blob|File)$/.test(e.constructor.name)&&/^(Blob|File)$/.test(e[Symbol.toStringTag]),s=e=>e instanceof FormData,i=e=>{const t=[],o=(e,n)=>{r(n)&&(Array.isArray(n)?n.forEach((t=>{o(e,t)})):"object"==typeof n?Object.entries(n).forEach((([t,r])=>{o(`${e}[${t}]`,r)})):((e,r)=>{t.push(`${encodeURIComponent(e)}=${encodeURIComponent(String(r))}`)})(e,n))};return Object.entries(e).forEach((([e,t])=>{o(e,t)})),t.length>0?`?${t.join("&")}`:""},c=async(e,t)=>"function"==typeof t?t(e):t,p=async(e,t)=>{const i=await c(t,e.TOKEN),p=await c(t,e.USERNAME),y=await c(t,e.PASSWORD),f=await c(t,e.HEADERS),d=Object.entries({Accept:"application/json",...f,...t.headers}).filter((([e,t])=>r(t))).reduce(((e,[t,r])=>({...e,[t]:String(r)})),{});if(n(i)&&(d.Authorization=`Bearer ${i}`),n(p)&&n(y)){const e=(e=>{try{return btoa(e)}catch(t){return Buffer.from(e).toString("base64")}})(`${p}:${y}`);d.Authorization=`Basic ${e}`}return t.body&&(t.mediaType?d["Content-Type"]=t.mediaType:a(t.body)?d["Content-Type"]=t.body.type||"application/octet-stream":o(t.body)?d["Content-Type"]="text/plain":s(t.body)||(d["Content-Type"]="application/json")),new Headers(d)},y=async(e,t,r,o,n,a,s)=>{const i=new XMLHttpRequest;return i.open(t.method,r,!0),i.withCredentials=e.WITH_CREDENTIALS,a.forEach(((e,t)=>{i.setRequestHeader(t,e)})),new Promise(((e,t)=>{i.onload=()=>e(i),i.onabort=()=>t(new Error("Request aborted")),i.onerror=()=>t(new Error("Network error")),i.send(o??n),s((()=>i.abort()))}))},f=(n,c)=>new t((async(t,f,d)=>{try{const f=((e,t)=>{const r=e.ENCODE_PATH||encodeURI,o=t.url.replace("{api-version}",e.VERSION).replace(/{(.*?)}/g,((e,o)=>t.path?.hasOwnProperty(o)?r(String(t.path[o])):e)),n=`${e.BASE}${o}`;return t.query?`${n}${i(t.query)}`:n})(n,c),b=(e=>{if(e.formData){const t=new FormData,n=(e,r)=>{o(r)||a(r)?t.append(e,r):t.append(e,JSON.stringify(r))};return Object.entries(e.formData).filter((([e,t])=>r(t))).forEach((([e,t])=>{Array.isArray(t)?t.forEach((t=>n(e,t))):n(e,t)})),t}})(c),l=(e=>{if(e.body)return e.mediaType?.includes("/json")?JSON.stringify(e.body):o(e.body)||a(e.body)||s(e.body)?e.body:JSON.stringify(e.body)})(c),h=await p(n,c);if(!d.isCancelled){const r=await y(n,c,f,l,b,h,d),a=(e=>{if(204!==e.status)try{const t=e.getResponseHeader("Content-Type");if(t)return t.toLowerCase().startsWith("application/json")?JSON.parse(e.responseText):e.responseText}catch(e){console.error(e)}})(r),s=((e,t)=>{if(t){const r=e.getResponseHeader(t);if(o(r))return r}})(r,c.responseHeader),i={url:f,ok:(u=r.status,u>=200&&u<300),status:r.status,statusText:r.statusText,body:s??a};((t,r)=>{const o={400:"Bad Request",401:"Unauthorized",403:"Forbidden",404:"Not Found",500:"Internal Server Error",502:"Bad Gateway",503:"Service Unavailable",...t.errors}[r.status];if(o)throw new e(t,r,o);if(!r.ok)throw new e(t,r,"Generic Error")})(c,i),t(i.body)}}catch(e){f(e)}var u}));export{f as request,y as sendRequest};
@@ -0,0 +1 @@
1
+ var r;!function(r){r.CRITICAL="Critical",r.MODERATE="Moderate",r.NORMAL="Normal"}(r||(r={}));export{r as ServiceNowUrgency};
@@ -0,0 +1 @@
1
+ var T;!function(T){T.TOP_LEFT="TOP_LEFT",T.TOP_RIGHT="TOP_RIGHT",T.BOTTOM_LEFT="BOTTOM_LEFT",T.BOTTOM_RIGHT="BOTTOM_RIGHT",T.CENTER="CENTER"}(T||(T={}));export{T as TutorialPosition};
@@ -0,0 +1 @@
1
+ import{OpenAPI_Portal as e,OpenAPI_Portal_Prod as r}from"../core/OpenAPI.js";import{request as t}from"../core/request.js";import"../models/TutorialPosition.js";import"../models/ServiceNowUrgency.js";class o{static createIncident(r){return t(e,{method:"POST",url:"/api/v1/ServiceNow/incident",body:r})}static fileUpload(r){return t(e,{method:"POST",url:"/api/v1/Slack/fileUpload",body:r})}static postmessage(r){return t(e,{method:"POST",url:"/api/v1/Slack/postmessage",body:r})}static getFeatureToggleFromApplicationName(e){return t(r,{method:"GET",url:"/api/v1/FeatureToggle/{applicationName}",path:{applicationName:e},errors:{400:"Bad Request",404:"Not Found",500:"Server Error"}})}static userApplications(){return t(e,{method:"GET",url:"/api/v1/AmplifyApplication/userapplications",errors:{400:"Bad Request",500:"Server Error"}})}}export{o as PortalService};
@@ -0,0 +1 @@
1
+ import{OpenAPI_Portal as e}from"../core/OpenAPI.js";import{request as t}from"../core/request.js";class a{static getReleasenoteList(a,r,s){return t(e,{method:"GET",url:"/api/v1/ReleaseNotes",query:{applicationName:a,version:r,tags:s}})}static getMyReleasenotes(){return t(e,{method:"GET",url:"/api/v1/ReleaseNotes/myreleasenotes"})}static getReleasenote(a,r){return t(e,{method:"GET",url:"/api/v1/ReleaseNotes/{applicationName}/{releaseId}",path:{applicationName:a,releaseId:r}})}static getContainerSasUri(){return t(e,{method:"GET",url:"/api/v1/ReleaseNotes/GetContainerSasUri",errors:{401:"Unauthorized"}})}}export{a as ReleaseNotesService};
@@ -0,0 +1 @@
1
+ import{OpenAPI_Portal_Prod as t}from"../core/OpenAPI.js";import{request as o}from"../core/request.js";class r{static getTutorialsForApplication(r){return o(t,{method:"GET",url:"/api/v1/Tutorial/{applicationName}",path:{applicationName:r}})}static getTutorialSasToken(){return o(t,{method:"GET",url:"/api/v1/Tutorial/SASToken"})}}export{r as TutorialService};
@@ -0,0 +1 @@
1
+ import{jsx as r,Fragment as o}from"react/jsx-runtime";import"../../providers/AuthProvider/AuthProvider.js";import"../../providers/TutorialStepsProvider.js";import{useFeatureToggling as t}from"../../hooks/useFeatureToggling.js";import"@tanstack/react-query";import"../../api/core/OpenAPI.js";import"../../utils/auth_environment.js";import"react";import"@equinor/amplify-components";import"@microsoft/signalr";import"../../types/Environment.js";const e=({featureKey:e,children:i,fallback:n,showIfKeyMissing:s=!0})=>{const{showContent:p}=t(e,s);return r(o,p?{children:i}:{children:n??null})};export{e as Feature};
@@ -0,0 +1 @@
1
+ import{useMemo as r}from"react";import{useFeatureToggleContext as e,isUserInActiveUserArray as t}from"../providers/FeatureToggleProvider.js";import{useAuth as o}from"../providers/AuthProvider/AuthProvider.js";import{environment as n}from"../utils/auth_environment.js";const{getEnvironmentName:i}=n;function s(n,s){const m=s??!0,{account:u}=o(),a=`${u?.username}`,v=i(import.meta.env.VITE_ENVIRONMENT_NAME),{features:c,isError:f}=e(),p=c?.find((r=>r.featureKey===n));return{showContent:r((()=>p?!!t(a,p.activeUsers)||p.activeEnvironments.includes(v):!f&&m),[m,v,p,f,a])}}export{s as useFeatureToggling};
@@ -0,0 +1 @@
1
+ import{useQuery as e}from"@tanstack/react-query";import{ReleaseNotesService as t}from"../api/services/ReleaseNotesService.js";import{environment as r}from"../utils/auth_environment.js";const{getAppName:n}=r;function o(r){const o=n(import.meta.env.VITE_NAME);return e({queryKey:["get-all-release-notes"],queryFn:()=>t.getReleasenoteList(o),enabled:r?.enabled??!0})}export{o as useReleaseNotesQuery};
@@ -0,0 +1 @@
1
+ import{useRef as e,useState as r,useMemo as n,useEffect as t}from"react";import{usePrevious as o}from"@equinor/amplify-components";import*as s from"@microsoft/signalr";import{LogLevel as i}from"@microsoft/signalr";import{useQuery as a}from"@tanstack/react-query";import{getPortalToken as c}from"../api/core/OpenAPI.js";import{EnvironmentType as u}from"../types/Environment.js";import{environment as m}from"../utils/auth_environment.js";function p(p){const d=e(void 0),[f,l]=r([]),[g,b]=r(),[v,w]=r(),{data:y}=a({queryKey:["get-amplify-portal-token"],queryFn:()=>c()}),E=n((()=>{const e=m.getEnvironmentName(import.meta.env.VITE_ENVIRONMENT_NAME);return`wss://api-amplify-portal-${e===u.LOCALHOST?u.DEVELOP:e}.radix.equinor.com`}),[]),N=o(p),S=o(y);t((()=>{(async function(){if(void 0===y||N===p&&S===y)return;void 0!==d.current&&N&&S&&(N!==p||S!==y)&&await d.current.stop();const e=(new s.HubConnectionBuilder).configureLogging(i.Error).withUrl(`${E}/hubs/notifications`,{accessTokenFactory:()=>y,withCredentials:!1,skipNegotiation:!0,transport:s.HttpTransportType.WebSockets}).withAutomaticReconnect().build();try{await e.start(),e.on("ActiveMessages",((e,r)=>{l(r.map((r=>({...r,Subject:e}))).reverse())})),e.onreconnected((()=>e.invoke("Subscribe",p))),e.on("NewMessage",((e,r)=>{l((n=>[{...r,Subject:e},...n]))})),e.on("UpdateMessage",((e,r)=>{w({...r,Subject:e})})),e.on("Delete",((e,r)=>{b(r)})),e.on("Error",(e=>{throw new Error("Connection error: "+e)})),await e.invoke("Subscribe",p),await e.invoke("PeekMessages")}catch(e){console.error("Connection failed",e)}d.current=e})().catch((e=>{console.error("Error setting up connection",e)}))}),[E,p,y,N,S]),t((()=>{if(v){const e=f.findIndex((e=>e.SequenceNumber===v.SequenceNumber)),r=[...f];e>-1&&(r[e]=v,l(r),w(void 0))}}),[v,f]),t((()=>{if(g){const e=f.findIndex((e=>e.SequenceNumber===g)),r=[...f];e>-1&&(r.splice(e,1),l(r),b(void 0))}}),[g,f]);const h=e=>{d.current&&(e.Read=!e.Read,d.current.invoke("PatchMessage",e.SequenceNumber,e).catch((e=>{console.error("Error setting message as read",e)})))},q=n((()=>f.some((e=>!1===e.Read))),[f]);return{messages:f,hasUnreadMessages:q,setMessageAsRead:h,setAllMessagesAsRead:()=>{f.forEach((e=>{e.Read||h(e)}))},deleteMessage:async function(e){d.current&&null!==e.SequenceNumber&&(await d.current.invoke("DeleteMessage",e.SequenceNumber),b(e.SequenceNumber))},closeConnection:async()=>{if(d.current)return await d.current.stop()}}}export{p as useSignalRMessages};
@@ -0,0 +1 @@
1
+ export{Feature}from"./components/Feature/Feature.js";export{default as AuthProvider,useAuth}from"./providers/AuthProvider/AuthProvider.js";export{default as TutorialStepsProvider,useTutorialSteps}from"./providers/TutorialStepsProvider.js";export{useFeatureToggling}from"./hooks/useFeatureToggling.js";export{useReleaseNotesQuery}from"./hooks/useReleaseNotesQuery.js";export{useSignalRMessages}from"./hooks/useSignalRMessages.js";export{default as TutorialProvider}from"./providers/TutorialProvider/TutorialProvider.js";export{default as FeatureToggleProvider}from"./providers/FeatureToggleProvider.js";export{EnvironmentType}from"./types/Environment.js";export{RELEASENOTE_TYPES_INFORMATION,ReleaseNoteType}from"./types/ReleaseNotes.js";export{auth,environment}from"./utils/auth_environment.js";
@@ -0,0 +1 @@
1
+ var p={jumbo__base:"88px",default__base:"48px",default__input:"56px",compact__standard:"32px",compact__input:"44px"};export{p as clickbounds};
@@ -0,0 +1 @@
1
+ var a={text:{static_icons__default:{hex:"#3d3d3d",hsla:"hsla(0, 0%, 23.9%, 1)",rgba:"var(--eds_text__static_icons__default, rgba(61, 61, 61, 1))"},static_icons__secondary:{hex:"#565656",hsla:"hsla(0, 0%, 33.7%, 1)",rgba:"var(--eds_text__static_icons__secondary, rgba(86, 86, 86, 1))"},static_icons__tertiary:{hex:"#6f6f6f",hsla:"hsla(0, 0%, 43.5%, 1)",rgba:"var(--eds_text__static_icons__tertiary, rgba(111, 111, 111, 1))"},static_icons__primary_white:{hex:"#ffffff",hsla:"hsla(0, 0%, 100%, 1)",rgba:"var(--eds_text__static_icons__primary_white, rgba(255, 255, 255, 1))"}},ui:{background__default:{hex:"#ffffff",hsla:"hsla(0, 0%, 100%, 1)",rgba:"var(--eds_ui_background__default, rgba(255, 255, 255, 1))"},background__semitransparent:{hex:"#ffffff",hsla:"hsla(0, 0%, 100%, 0.2)",rgba:"var(--eds_ui_background__semitransparent, rgba(255, 255, 255, 0.2))"},background__light:{hex:"#f7f7f7",hsla:"hsla(0, 0%, 96.9%, 1)",rgba:"var(--eds_ui_background__light, rgba(247, 247, 247, 1))"},background__scrim:{hex:"#000000",hsla:"hsla(0, 0%, 0%, 0.4)",rgba:"var(--eds_ui_background__scrim, rgba(0, 0, 0, 0.4))"},background__overlay:{hex:"#000000",hsla:"hsla(0, 0%, 0%, 0.8)",rgba:"var(--eds_ui_background__overlay, rgba(0, 0, 0, 0.8))"},background__medium:{hex:"#dcdcdc",hsla:"hsla(0, 0%, 86.3%, 1)",rgba:"var(--eds_ui_background__medium, rgba(220, 220, 220, 1))"},background__info:{hex:"#d5eaf4",hsla:"hsla(199, 58.5%, 89.6%, 1)",rgba:"var(--eds_ui_background__info, rgba(213, 234, 244, 1))"},background__warning:{hex:"#ffe7d6",hsla:"hsla(25, 100%, 92%, 1)",rgba:"var(--eds_ui_background__warning, rgba(255, 231, 214, 1))"},background__danger:{hex:"#ffc1c1",hsla:"hsla(0, 100%, 87.8%, 1)",rgba:"var(--eds_ui_background__danger, rgba(255, 193, 193, 1))"}},infographic:{substitute__purple_berry:{hex:"#8c1159",hsla:"hsla(325, 78.3%, 30.8%, 1)",rgba:"var(--eds_infographic_substitute__purple_berry, rgba(140, 17, 89, 1))"},substitute__pink_rose:{hex:"#e24973",hsla:"hsla(344, 72.5%, 58.6%, 1)",rgba:"var(--eds_infographic_substitute__pink_rose, rgba(226, 73, 115, 1))"},substitute__pink_salmon:{hex:"#ff92a8",hsla:"hsla(348, 100%, 78.6%, 1)",rgba:"var(--eds_infographic_substitute__pink_salmon, rgba(255, 146, 168, 1))"},substitute__green_cucumber:{hex:"#005f57",hsla:"hsla(175, 100%, 18.6%, 1)",rgba:"var(--eds_infographic_substitute__green_cucumber, rgba(0, 95, 87, 1))"},substitute__green_succulent:{hex:"#00977b",hsla:"hsla(169, 100%, 29.6%, 1)",rgba:"var(--eds_infographic_substitute__green_succulent, rgba(0, 151, 123, 1))"},substitute__green_mint:{hex:"#40d38f",hsla:"hsla(152, 62.6%, 53.9%, 1)",rgba:"var(--eds_infographic_substitute__green_mint, rgba(64, 211, 143, 1))"},substitute__blue_ocean:{hex:"#004088",hsla:"hsla(212, 100%, 26.7%, 1)",rgba:"var(--eds_infographic_substitute__blue_ocean, rgba(0, 64, 136, 1))"},substitute__blue_overcast:{hex:"#0084c4",hsla:"hsla(200, 100%, 38.4%, 1)",rgba:"var(--eds_infographic_substitute__blue_overcast, rgba(0, 132, 196, 1))"},substitute__blue_sky:{hex:"#52c0ff",hsla:"hsla(202, 100%, 66.1%, 1)",rgba:"var(--eds_infographic_substitute__blue_sky, rgba(82, 192, 255, 1))"},primary__moss_green_100:{hex:"#007079",hsla:"hsla(184, 100%, 23.7%, 1)",rgba:"var(--eds_infographic_primary__moss_green_100, rgba(0, 112, 121, 1))"},primary__moss_green_55:{hex:"#73b1b5",hsla:"hsla(184, 30.8%, 58%, 1)",rgba:"var(--eds_infographic_primary__moss_green_55, rgba(115, 177, 181, 1))"},primary__moss_green_34:{hex:"#a8ced1",hsla:"hsla(184, 30.8%, 73.9%, 1)",rgba:"var(--eds_infographic_primary__moss_green_34, rgba(168, 206, 209, 1))"},primary__moss_green_21:{hex:"#c9e0e2",hsla:"hsla(185, 30.1%, 83.7%, 1)",rgba:"var(--eds_infographic_primary__moss_green_21, rgba(201, 224, 226, 1))"},primary__moss_green_13:{hex:"#deedee",hsla:"hsla(184, 32%, 90.2%, 1)",rgba:"var(--eds_infographic_primary__moss_green_13, rgba(222, 237, 238, 1))"},primary__energy_red_100:{hex:"#eb0037",hsla:"hsla(346, 100%, 46.1%, 1)",rgba:"var(--eds_infographic_primary__energy_red_100, rgba(235, 0, 55, 1))"},primary__energy_red_55:{hex:"#ff7d98",hsla:"hsla(348, 100%, 74.5%, 1)",rgba:"var(--eds_infographic_primary__energy_red_55, rgba(255, 125, 152, 1))"},primary__energy_red_34:{hex:"#ffaebf",hsla:"hsla(347, 100%, 84.1%, 1)",rgba:"var(--eds_infographic_primary__energy_red_34, rgba(255, 174, 191, 1))"},primary__energy_red_21:{hex:"#ffcdd7",hsla:"hsla(348, 100%, 90.2%, 1)",rgba:"var(--eds_infographic_primary__energy_red_21, rgba(255, 205, 215, 1))"},primary__energy_red_13:{hex:"#ffe0e7",hsla:"hsla(346, 100%, 93.9%, 1)",rgba:"var(--eds_infographic_primary__energy_red_13, rgba(255, 224, 231, 1))"},primary__weathered_red:{hex:"#7d0023",hsla:"hsla(343, 100%, 24.5%, 1)",rgba:"var(--eds_infographic_primary__weathered_red, rgba(125, 0, 35, 1))"},primary__slate_blue:{hex:"#243746",hsla:"hsla(206, 32.1%, 20.8%, 1)",rgba:"var(--eds_infographic_primary__slate_blue, rgba(36, 55, 70, 1))"},primary__spruce_wood:{hex:"#ffe7d6",hsla:"hsla(25, 100%, 92%, 1)",rgba:"var(--eds_infographic_primary__spruce_wood, rgba(255, 231, 214, 1))"},primary__mist_blue:{hex:"#d5eaf4",hsla:"hsla(199, 58.5%, 89.6%, 1)",rgba:"var(--eds_infographic_primary__mist_blue, rgba(213, 234, 244, 1))"},primary__lichen_green:{hex:"#e6faec",hsla:"hsla(138, 66.7%, 94.1%, 1)",rgba:"var(--eds_infographic_primary__lichen_green, rgba(230, 250, 236, 1))"}},logo:{fill_positive:{hex:"#eb0037",hsla:"hsla(346, 100%, 46.1%, 1)",rgba:"var(--eds_logo__fill_positive, rgba(235, 0, 55, 1))"},fill_negative:{hex:"#ffffff",hsla:"hsla(0, 0%, 100%, 1)",rgba:"var(--eds_logo__fill_negative, rgba(255, 255, 255, 1))"}},interactive:{primary__selected_highlight:{hex:"#e6faec",hsla:"hsla(138, 66.7%, 94.1%, 1)",rgba:"var(--eds_interactive_primary__selected_highlight, rgba(230, 250, 236, 1))"},primary__selected_hover:{hex:"#c3f3d2",hsla:"hsla(139, 66.7%, 85.9%, 1)",rgba:"var(--eds_interactive_primary__selected_hover, rgba(195, 243, 210, 1))"},primary__resting:{hex:"#007079",hsla:"hsla(184, 100%, 23.7%, 1)",rgba:"var(--eds_interactive_primary__resting, rgba(0, 112, 121, 1))"},primary__hover:{hex:"#004f55",hsla:"hsla(184, 100%, 16.7%, 1)",rgba:"var(--eds_interactive_primary__hover, rgba(0, 79, 85, 1))"},primary__hover_alt:{hex:"#deedee",hsla:"hsla(184, 32%, 90.2%, 1)",rgba:"var(--eds_interactive_primary__hover_alt, rgba(222, 237, 238, 1))"},secondary__highlight:{hex:"#d5eaf4",hsla:"hsla(199, 58.5%, 89.6%, 1)",rgba:"var(--eds_interactive_secondary__highlight, rgba(213, 234, 244, 1))"},secondary__resting:{hex:"#243746",hsla:"hsla(206, 32.1%, 20.8%, 1)",rgba:"var(--eds_interactive_secondary__resting, rgba(36, 55, 70, 1))"},secondary__link_hover:{hex:"#17242f",hsla:"hsla(208, 34.3%, 13.7%, 1)",rgba:"var(--eds_interactive_secondary__link_hover, rgba(23, 36, 47, 1))"},danger__highlight:{hex:"#ffc1c1",hsla:"hsla(0, 100%, 87.8%, 1)",rgba:"var(--eds_interactive_danger__highlight, rgba(255, 193, 193, 1))"},danger__resting:{hex:"#eb0000",hsla:"hsla(0, 100%, 46.1%, 1)",rgba:"var(--eds_interactive_danger__resting, rgba(235, 0, 0, 1))"},danger__hover:{hex:"#b30d2f",hsla:"hsla(348, 86.5%, 37.6%, 1)",rgba:"var(--eds_interactive_danger__hover, rgba(179, 13, 47, 1))"},danger__text:{hex:"#b30d2f",hsla:"hsla(348, 86.5%, 37.6%, 1)",rgba:"var(--eds_interactive_danger__text, rgba(179, 13, 47, 1))"},warning__highlight:{hex:"#ffe7d6",hsla:"hsla(25, 100%, 92%, 1)",rgba:"var(--eds_interactive_warning__highlight, rgba(255, 231, 214, 1))"},warning__resting:{hex:"#ff9200",hsla:"hsla(34, 100%, 50%, 1)",rgba:"var(--eds_interactive_warning__resting, rgba(255, 146, 0, 1))"},warning__hover:{hex:"#ad6200",hsla:"hsla(34, 100%, 33.9%, 1)",rgba:"var(--eds_interactive_warning__hover, rgba(173, 98, 0, 1))"},warning__text:{hex:"#ad6200",hsla:"hsla(34, 100%, 33.9%, 1)",rgba:"var(--eds_interactive_warning__text, rgba(173, 98, 0, 1))"},success__highlight:{hex:"#e6faec",hsla:"hsla(138, 66.7%, 94.1%, 1)",rgba:"var(--eds_interactive_success__highlight, rgba(230, 250, 236, 1))"},success__resting:{hex:"#4bb748",hsla:"hsla(118, 43.5%, 50%, 1)",rgba:"var(--eds_interactive_success__resting, rgba(75, 183, 72, 1))"},success__hover:{hex:"#358132",hsla:"hsla(118, 44.1%, 35.1%, 1)",rgba:"var(--eds_interactive_success__hover, rgba(53, 129, 50, 1))"},success__text:{hex:"#358132",hsla:"hsla(118, 44.1%, 35.1%, 1)",rgba:"var(--eds_interactive_success__text, rgba(53, 129, 50, 1))"},table__cell__fill_resting:{hex:"#ffffff",hsla:"hsla(0, 0%, 100%, 1)",rgba:"var(--eds_interactive_table__cell__fill_resting, rgba(255, 255, 255, 1))"},table__cell__fill_hover:{hex:"#eaeaea",hsla:"hsla(0, 0%, 91.8%, 1)",rgba:"var(--eds_interactive_table__cell__fill_hover, rgba(234, 234, 234, 1))"},table__cell__fill_activated:{hex:"#e6faec",hsla:"hsla(138, 66.7%, 94.1%, 1)",rgba:"var(--eds_interactive_table__cell__fill_activated, rgba(230, 250, 236, 1))"},table__header__fill_activated:{hex:"#eaeaea",hsla:"hsla(0, 0%, 91.8%, 1)",rgba:"var(--eds_interactive_table__header__fill_activated, rgba(234, 234, 234, 1))"},table__header__fill_hover:{hex:"#dcdcdc",hsla:"hsla(0, 0%, 86.3%, 1)",rgba:"var(--eds_interactive_table__header__fill_hover, rgba(220, 220, 220, 1))"},table__header__fill_resting:{hex:"#f7f7f7",hsla:"hsla(0, 0%, 96.9%, 1)",rgba:"var(--eds_interactive_table__header__fill_resting, rgba(247, 247, 247, 1))"},disabled__text:{hex:"#bebebe",hsla:"hsla(0, 0%, 74.5%, 1)",rgba:"var(--eds_interactive__disabled__text, rgba(190, 190, 190, 1))"},text_highlight:{hex:"#d5eaf4",hsla:"hsla(199, 58.5%, 89.6%, 1)",rgba:"var(--eds_interactive__text_highlight, rgba(213, 234, 244, 1))"},focus:{hex:"#007079",hsla:"hsla(184, 100%, 23.7%, 1)",rgba:"var(--eds_interactive__focus, rgba(0, 112, 121, 1))"},disabled__border:{hex:"#dcdcdc",hsla:"hsla(0, 0%, 86.3%, 1)",rgba:"var(--eds_interactive__disabled__border, rgba(220, 220, 220, 1))"},disabled__fill:{hex:"#eaeaea",hsla:"hsla(0, 0%, 91.8%, 1)",rgba:"var(--eds_interactive__disabled__fill, rgba(234, 234, 234, 1))"},link_on_interactive_colors:{hex:"#ffffff",hsla:"hsla(0, 0%, 100%, 1)",rgba:"var(--eds_interactive__link_on_interactive_colors, rgba(255, 255, 255, 1))"},icon_on_interactive_colors:{hex:"#ffffff",hsla:"hsla(0, 0%, 100%, 1)",rgba:"var(--eds_interactive__icon_on_interactive_colors, rgba(255, 255, 255, 1))"},link_in_snackbars:{hex:"#97cace",hsla:"hsla(184, 35.9%, 70%, 1)",rgba:"var(--eds_interactive__link_in_snackbars, rgba(151, 202, 206, 1))"},pressed_overlay_dark:{hex:"#000000",hsla:"hsla(0, 0%, 0%, 0.2)",rgba:"var(--eds_interactive__pressed_overlay_dark, rgba(0, 0, 0, 0.2))"},pressed_overlay_light:{hex:"#ffffff",hsla:"hsla(0, 0%, 100%, 0.2)",rgba:"var(--eds_interactive__pressed_overlay_light, rgba(255, 255, 255, 0.2))"}}};export{a as colors};
@@ -0,0 +1 @@
1
+ var p={raised:"0 1px 5px rgba(0, 0, 0, 0.2),0 3px 4px rgba(0, 0, 0, 0.12),0 2px 4px rgba(0, 0, 0, 0.14)",none:"0 0 1px rgba(0, 0, 0, 0.14)",overlay:"0 1px 10px rgba(0, 0, 0, 0.2),0 4px 5px rgba(0, 0, 0, 0.12),0 2px 4px rgba(0, 0, 0, 0.14)",sticky:"0 4px 5px rgba(0, 0, 0, 0.2),0 3px 14px rgba(0, 0, 0, 0.12),0 8px 10px rgba(0, 0, 0, 0.14)",temporary_nav:"0 7px 8px rgba(0, 0, 0, 0.2),0 5px 22px rgba(0, 0, 0, 0.12),0 12px 17px rgba(0, 0, 0, 0.14)",above_scrim:"0 11px 15px rgba(0, 0, 0, 0.2),0 9px 46px rgba(0, 0, 0, 0.12),0 24px 38px rgba(0, 0, 0, 0.14)"};export{p as elevation};
@@ -0,0 +1 @@
1
+ import{clickbounds as o}from"./clickbounds.js";import{colors as r}from"./colors.js";import{elevation as s}from"./elevation.js";import{interactions as i}from"./interactions.js";import{shape as p}from"./shape.js";import{typography as t}from"./typography.js";import{spacings as m}from"./spacings.js";var a={clickbounds:o,colors:r,elevation:s,interactions:i,shape:p,typography:t,spacings:m};export{a as tokens};
@@ -0,0 +1 @@
1
+ var e={_modes:{compact:{pressed_dark_overlay:{blendMode:"pass_through",pressedColor:"transparent"},focused:{style:"dashed",color:"rgba(0, 112, 121, 1)",width:"2px"},pressed_light_overlay:{blendMode:"pass_through",pressedColor:"rgba(255, 255, 255, 1)"}}},pressed_dark_overlay:{blendMode:"darken",pressedColor:"rgba(0, 0, 0, 0.2)"},focused:{style:"dashed",color:"rgba(0, 112, 121, 1)",width:"2px"},pressed_light_overlay:{blendMode:"pass_through",pressedColor:"rgba(255, 255, 255, 0.2)"}};export{e as interactions};
@@ -0,0 +1 @@
1
+ var i={_modes:{compact:{rounded:{minHeight:"24px",minWidth:"80px",borderRadius:"100px"},button:{minHeight:"24px",minWidth:"112px",borderRadius:"4px"},toggle:{minHeight:"24px",minWidth:"112px",borderRadius:"4px"},corners:{minHeight:"24px",minWidth:"112px",borderRadius:"4px"},icon_button:{minHeight:"32px",minWidth:"32px",borderRadius:"100px"},straight:{minHeight:"24px",minWidth:"112px",borderRadius:""},toggle_rounded_border:{minHeight:"24px",minWidth:"2px",borderRadius:""},toggle_straight_border:{minHeight:"24px",minWidth:"2px",borderRadius:""},circle:{minHeight:"24px",minWidth:"24px",borderRadius:"100px"}}},toggle_straight_border:{minHeight:"36px",minWidth:"4px",borderRadius:""},toggle_rounded_border:{minHeight:"36px",minWidth:"4px",borderRadius:""},circle:{minHeight:"40px",minWidth:"40px",borderRadius:"100px"},rounded:{minHeight:"40px",minWidth:"80px",borderRadius:"100px"},button:{minHeight:"36px",minWidth:"112px",borderRadius:"4px"},toggle:{minHeight:"36px",minWidth:"112px",borderRadius:"4px"},corners:{minHeight:"36px",minWidth:"112px",borderRadius:"4px"},icon_button:{minHeight:"40px",minWidth:"40px",borderRadius:"100px"},field:{minHeight:"56px",minWidth:"294px",borderRadius:""},straight:{minHeight:"36px",minWidth:"112px",borderRadius:""},caret:{minHeight:"8px",minWidth:"6px",borderRadius:""}};export{i as shape};
@@ -0,0 +1 @@
1
+ var x={comfortable:{xxx_large:"48px",xx_large:"40px",x_large:"32px",large:"24px",medium:"16px",medium_small:"12px",small:"8px",x_small:"4px",xx_small:"2px"}};export{x as spacings};
@@ -0,0 +1 @@
1
+ var e={heading:{h1_bold:{color:"var(--eds_heading__h1_bold_color, rgba(61, 61, 61, 1))",fontFamily:"Equinor",fontSize:"2.000rem",fontWeight:700,lineHeight:"1.250em",textAlign:"left"},h1:{color:"var(--eds_heading__h1_color, rgba(61, 61, 61, 1))",fontFamily:"Equinor",fontSize:"2.000rem",fontWeight:400,lineHeight:"1.250em",textAlign:"left"},h2:{color:"var(--eds_heading__h2_color, rgba(61, 61, 61, 1))",fontFamily:"Equinor",fontSize:"1.750rem",fontWeight:400,lineHeight:"1.250em",textAlign:"left"},h3:{color:"var(--eds_heading__h3_color, rgba(61, 61, 61, 1))",fontFamily:"Equinor",fontSize:"1.500rem",fontWeight:400,lineHeight:"1.250em",textAlign:"left"},h4:{color:"var(--eds_heading__h4_color, rgba(61, 61, 61, 1))",fontFamily:"Equinor",fontSize:"1.250rem",fontWeight:400,lineHeight:"1.600em",textAlign:"left"},h5:{color:"var(--eds_heading__h5_color, rgba(61, 61, 61, 1))",fontFamily:"Equinor",fontSize:"1.125rem",fontWeight:500,letterSpacing:"0.013em",lineHeight:"1.333em",textAlign:"left"},h6:{color:"var(--eds_heading__h6_color, rgba(61, 61, 61, 1))",fontFamily:"Equinor",fontSize:"1.000rem",fontWeight:500,letterSpacing:"0.013em",lineHeight:"1.500em",textAlign:"left"}},navigation:{menu_title:{color:"var(--eds_navigation__menu_title_color, rgba(61, 61, 61, 1))",fontFamily:"Equinor",fontSize:"1.000rem",fontWeight:400,letterSpacing:"0.013em",lineHeight:"1.000em",textAlign:"left"},menu_tabs:{color:"var(--eds_navigation__menu_tabs_color, rgba(61, 61, 61, 1))",fontFamily:"Equinor",fontSize:"1.000rem",fontWeight:500,letterSpacing:"0.013em",lineHeight:"1.000em",textAlign:"left"},label:{color:"var(--eds_navigation__label_color, rgba(0, 0, 0, 1))",fontFamily:"Equinor",fontSize:"0.750rem",fontWeight:500,lineHeight:"1.333em",textAlign:"left"},drawer_active:{color:"var(--eds_navigation__drawer_active_color, rgba(0, 0, 0, 1))",fontFamily:"Equinor",fontSize:"1.000rem",fontWeight:700,letterSpacing:"0.006em",lineHeight:"1.000em",textAlign:"left"},drawer_inactive:{color:"var(--eds_navigation__drawer_inactive_color, rgba(0, 0, 0, 1))",fontFamily:"Equinor",fontSize:"1.000rem",fontWeight:500,letterSpacing:"0.013em",lineHeight:"1.000em",textAlign:"left"},button:{color:"var(--eds_navigation__button_color, rgba(0, 0, 0, 1))",fontFamily:"Equinor",fontSize:"0.875rem",fontWeight:500,lineHeight:"1.143em",textAlign:"left"},breadcrumb:{color:"var(--eds_navigation__breadcrumb_color, rgba(0, 0, 0, 1))",fontFamily:"Equinor",fontSize:"0.875rem",fontWeight:500,lineHeight:"1.143em",textAlign:"left"},breadcrumb_hover:{color:"var(--eds_navigation__breadcrumb_hover_color, rgba(0, 0, 0, 1))",fontFamily:"Equinor",fontSize:"0.875rem",fontWeight:500,lineHeight:"1.143em",textDecoration:"underline",textAlign:"left"},menu_title_hover:{color:"var(--eds_navigation__menu_title_hover_color, rgba(61, 61, 61, 1))",fontFamily:"Equinor",fontSize:"1.000rem",fontWeight:400,letterSpacing:"0.013em",lineHeight:"1.000em",textAlign:"left"}},input:{label:{color:"var(--eds_input__label_color, rgba(0, 0, 0, 1))",fontFamily:"Equinor",fontSize:"0.750rem",fontWeight:500,lineHeight:"1.333em",textAlign:"left"},text:{color:"var(--eds_input__text_color, rgba(0, 0, 0, 1))",fontFamily:"Equinor",fontSize:"1.000rem",fontWeight:400,letterSpacing:"0.025em",lineHeight:"1.500em",textAlign:"left"},text_monospaced:{fontFeature:"'tnum' on,'lnum' on",color:"var(--eds_input__text_monospaced_color, rgba(0, 0, 0, 1))",fontFamily:"Equinor",fontSize:"1.000rem",fontWeight:400,letterSpacing:"0.063em",lineHeight:"1.500em",textAlign:"left"},helper:{color:"var(--eds_input__helper_color, rgba(0, 0, 0, 1))",fontFamily:"Equinor",fontSize:"0.750rem",fontWeight:500,letterSpacing:"0.013em",lineHeight:"1.333em",textAlign:"left"}},paragraph:{body_short_italic:{color:"var(--eds_paragraph__body_short_italic_color, rgba(61, 61, 61, 1))",fontFamily:"Equinor",fontSize:"1.000rem",fontWeight:400,lineHeight:"1.250em",fontStyle:"italic",textAlign:"left"},caption:{color:"var(--eds_paragraph__caption_color, rgba(61, 61, 61, 1))",fontFamily:"Equinor",fontSize:"0.875rem",fontWeight:500,lineHeight:"1.143em",textAlign:"left"},meta:{color:"var(--eds_paragraph__meta_color, rgba(61, 61, 61, 1))",fontFamily:"Equinor",fontSize:"0.625rem",fontWeight:500,lineHeight:"1.600em",textAlign:"left"},body_short:{color:"var(--eds_paragraph__body_short_color, rgba(61, 61, 61, 1))",fontFamily:"Equinor",fontSize:"1.000rem",fontWeight:400,lineHeight:"1.250em",textAlign:"left"},body_short_bold_italic:{color:"var(--eds_paragraph__body_short_bold_italic_color, rgba(61, 61, 61, 1))",fontFamily:"Equinor",fontSize:"1.000rem",fontWeight:700,lineHeight:"1.250em",fontStyle:"italic",textAlign:"left"},body_short_bold:{color:"var(--eds_paragraph__body_short_bold_color, rgba(61, 61, 61, 1))",fontFamily:"Equinor",fontSize:"1.000rem",fontWeight:700,lineHeight:"1.250em",textAlign:"left"},body_short_link:{color:"var(--eds_paragraph__body_short_link_color, rgba(0, 112, 121, 1))",fontFamily:"Equinor",fontSize:"1.000rem",fontWeight:400,lineHeight:"1.250em",textDecoration:"underline",textAlign:"left"},overline:{color:"var(--eds_paragraph__overline_color, rgba(61, 61, 61, 1))",fontFamily:"Equinor",fontSize:"0.625rem",fontWeight:500,letterSpacing:"0.069em",lineHeight:"1.600em",textTransform:"uppercase",textAlign:"left"},ingress:{color:"var(--eds_paragraph__ingress_color, rgba(61, 61, 61, 1))",fontFamily:"Equinor",fontSize:"1.125rem",fontWeight:400,lineHeight:"1.333em",textAlign:"left"},body_long:{color:"var(--eds_paragraph__body_long_color, rgba(61, 61, 61, 1))",fontFamily:"Equinor",fontSize:"1.000rem",fontWeight:400,lineHeight:"1.500em",textAlign:"left"},body_long_link:{color:"var(--eds_paragraph__body_long_link_color, rgba(0, 112, 121, 1))",fontFamily:"Equinor",fontSize:"1.000rem",fontWeight:400,lineHeight:"1.500em",textDecoration:"underline",textAlign:"left"},body_long_italic:{color:"var(--eds_paragraph__body_long_italic_color, rgba(61, 61, 61, 1))",fontFamily:"Equinor",fontSize:"1.000rem",fontWeight:400,lineHeight:"1.500em",fontStyle:"italic",textAlign:"left"},body_long_bold:{color:"var(--eds_paragraph__body_long_bold_color, rgba(61, 61, 61, 1))",fontFamily:"Equinor",fontSize:"1.000rem",fontWeight:700,lineHeight:"1.500em",textAlign:"left"},body_long_bold_italic:{color:"var(--eds_paragraph__body_long_bold_italic_color, rgba(61, 61, 61, 1))",fontFamily:"Equinor",fontSize:"1.000rem",fontWeight:700,lineHeight:"1.500em",fontStyle:"italic",textAlign:"left"}},table:{cell_header:{color:"var(--eds_table__cell_header_color, rgba(0, 0, 0, 1))",fontFamily:"Equinor",fontSize:"0.875rem",fontWeight:700,lineHeight:"1.429em",textAlign:"left"},cell_text:{color:"var(--eds_table__cell_text_color, rgba(0, 0, 0, 1))",fontFamily:"Equinor",fontSize:"0.875rem",fontWeight:500,lineHeight:"1.429em",textAlign:"left"},cell_text_bold:{color:"var(--eds_table__cell_text_bold_color, rgba(0, 0, 0, 1))",fontFamily:"Equinor",fontSize:"0.875rem",fontWeight:700,lineHeight:"1.429em",textAlign:"left"},cell_text_link:{color:"var(--eds_table__cell_text_link_color, rgba(0, 0, 0, 1))",fontFamily:"Equinor",fontSize:"0.875rem",fontWeight:500,lineHeight:"1.429em",textDecoration:"underline",textAlign:"left"},cell_numeric_monospaced:{fontFeature:"'tnum' on,'lnum' on",color:"var(--eds_table__cell_numeric_monospaced_color, rgba(0, 0, 0, 1))",fontFamily:"Equinor",fontSize:"0.875rem",fontWeight:500,lineHeight:"1.429em",textAlign:"left"}},_modes:{compact:{table:{cell_header:{color:"var(--eds_table__cell_header_color, rgba(0, 0, 0, 1))",fontFamily:"Equinor",fontSize:"0.875rem",fontWeight:700,lineHeight:"1.143em",textAlign:"left"},cell_text:{color:"var(--eds_table__cell_text_color, rgba(0, 0, 0, 1))",fontFamily:"Equinor",fontSize:"0.875rem",fontWeight:500,lineHeight:"1.143em",textAlign:"left"},cell_text_bold:{color:"var(--eds_table__cell_text_bold_color, rgba(0, 0, 0, 1))",fontFamily:"Equinor",fontSize:"0.875rem",fontWeight:700,lineHeight:"1.143em",textAlign:"left"},cell_text_link:{color:"var(--eds_table__cell_text_link_color, rgba(0, 0, 0, 1))",fontFamily:"Equinor",fontSize:"0.875rem",fontWeight:500,lineHeight:"1.143em",textDecoration:"underline",textAlign:"left"},cell_numeric_monospaced:{fontFeature:"'tnum' on,'lnum' on",color:"var(--eds_table__cell_numeric_monospaced_color, rgba(0, 0, 0, 1))",fontFamily:"Equinor",fontSize:"0.875rem",fontWeight:500,lineHeight:"1.143em",textAlign:"left"}}}},ui:{tooltip:{color:"var(--eds_ui__tooltip_color, rgba(61, 61, 61, 1))",fontFamily:"Equinor",fontSize:"0.750rem",fontWeight:500,lineHeight:"1.333em",textAlign:"left"},snackbar:{color:"var(--eds_ui__snackbar_color, rgba(61, 61, 61, 1))",fontFamily:"Equinor",fontSize:"0.750rem",fontWeight:500,lineHeight:"1.333em",textAlign:"left"},accordion_header:{color:"var(--eds_ui__accordion_header_color, rgba(61, 61, 61, 1))",fontFamily:"Equinor",fontSize:"1.000rem",fontWeight:500,lineHeight:"1.500em",textAlign:"left"},chip__badge:{color:"var(--eds_ui__chip__badge_color, rgba(61, 61, 61, 1))",fontFamily:"Equinor",fontSize:"0.750rem",fontWeight:500,lineHeight:"1.333em",textAlign:"left"},chart:{color:"var(--eds_ui__chart_color, rgba(61, 61, 61, 1))",fontFamily:"Equinor",fontSize:"0.750rem",fontWeight:500,lineHeight:"1.333em",textAlign:"left"}}};export{e as typography};
@@ -0,0 +1 @@
1
+ import{jsx as o}from"react/jsx-runtime";import{createContext as t,useContext as e,useState as n,useMemo as r}from"react";import{MsalProvider as c}from"@azure/msal-react";import u from"./AuthProviderInner.js";import{auth as i,environment as a}from"../../utils/auth_environment.js";const{msalApp:m}=i,{getIsMock:s}=a,d=t(void 0),l=()=>{const o=e(d);if(void 0===o)throw new Error("useAuth must be used within a AuthContext provider");return o},h=({children:t,loadingComponent:e,unauthorizedComponent:i})=>{const[a,l]=n(void 0),[h,p]=n(),[v,g]=n("loading"),[k,A]=n(),f=r((()=>s(import.meta.env.VITE_IS_MOCK)),[]);return o(d.Provider,f?{value:{roles:["mock"],account:{homeAccountId:"mock-home-account-id",environment:"mock",tenantId:"mock-tenant-id",username:"MockUser@euquinor.com",localAccountId:"mock-local-account-id",name:"Mock mocksnes"},photo:k,logout:()=>console.log("Logged out the user!")},children:t}:{value:{roles:h,account:a,photo:k,logout:()=>m.logoutRedirect()},children:o(c,{instance:m,children:o(u,{loadingComponent:e,unauthorizedComponent:i,account:a,setAccount:l,setRoles:p,setPhoto:A,authState:v,setAuthState:g,children:t})})})};export{h as default,l as useAuth};
@@ -0,0 +1 @@
1
+ import{jsx as o,Fragment as e}from"react/jsx-runtime";import{useState as t,useRef as r,useEffect as n}from"react";import{InteractionType as i,InteractionRequiredAuthError as c}from"@azure/msal-browser";import{useMsal as a,useMsalAuthentication as s}from"@azure/msal-react";import{FullPageSpinner as u,Unauthorized as l}from"@equinor/amplify-components";import{auth as d,environment as h}from"../../utils/auth_environment.js";import{jwtDecode as A}from"jwt-decode";const{GRAPH_ENDPOINTS:g,GRAPH_REQUESTS_LOGIN:m,GRAPH_REQUESTS_PHOTO:P,GRAPH_REQUESTS_BACKEND:v,fetchMsGraph:f,isInIframe:p}=d,{getApiScope:w}=h,S=({children:d,account:h,setAccount:S,setPhoto:T,setRoles:E,authState:R,setAuthState:y,loadingComponent:z,unauthorizedComponent:_})=>{const{instance:k,accounts:O,inProgress:I}=a(),{login:U,result:G,error:H,acquireToken:b}=s(i.Silent,m),[N,j]=t(!1),q=r(!1);return n((()=>{if(N)return;(async()=>{console.log("[AuthProvider] Initializing"),await k.initialize(),console.log("[AuthProvider] Finished initializing"),j(!0)})().catch((o=>{console.error("[AuthProvider] Error during initialization",o)}))}),[k,N]),n((()=>{N&&(H instanceof c&&!p()?(console.error(H),console.log("[AuthProvider] No account found, need to login via. redirect"),U(i.Redirect,m).catch((o=>{console.error("[AuthProvider] Error during login",o)}))):G?.account&&!h?(console.log("[AuthProvider] Found account in useMsalAuth result, setting that one as active"),k.setActiveAccount(G.account),S(G.account)):O.length>0&&!h?(console.log("[AuthProvider] Found account in accounts array, setting that one as active"),k.setActiveAccount(O[0]),S(O[0])):H&&console.error("[AuthProvider] Unexpected error:",H))}),[h,O,H,k,N,U,G,S]),n((()=>{if(!h||!N||q.current||"none"!==I)return;q.current=!0;(async()=>{await(async()=>{try{const o=await b(i.Silent,P);if(o){const e=await f(g.PHOTO,o.accessToken);if(404===e.status)return null;const t=await e.blob(),r=(window.URL??window.webkitURL).createObjectURL(t);T(r)}}catch(o){console.error(o)}})(),await(async()=>{try{const o=await b(i.Silent,v(w(import.meta.env.VITE_API_SCOPE)));if(console.log("[AuthProvider] Successfully acquired token"),o&&o.accessToken){console.log("[AuthProvider] Decoding token");const e=A(o.accessToken);console.log("[AuthProvider] Token was valid"),e.roles&&(console.log("[AuthProvider] Found roles"),E(e.roles)),y("authorized")}}catch(o){console.error("[AuthProvider] Token error when trying to get roles!",o),y("unauthorized")}})()})()}),[h,b,H,N,I,y,T,E]),"loading"===R||void 0===h?z??o(u,{variant:"equinor",withoutScrim:!0}):"unauthorized"===R?_??o(l,{}):o(e,{children:d})};export{S as default};
@@ -0,0 +1 @@
1
+ import{jsx as e}from"react/jsx-runtime";import{createContext as r,useContext as t}from"react";import{FullPageSpinner as o}from"@equinor/amplify-components";import{useQuery as i}from"@tanstack/react-query";import{PortalService as a}from"../api/services/PortalService.js";import{environment as n}from"../utils/auth_environment.js";const{getAppName:m}=n,s=(e,r)=>!!(r&&r.length>0)&&r.map((e=>e.mail.toLowerCase())).includes(e.toLowerCase()),u=r(void 0);function p(){const e=t(u);if(void 0===e)throw new Error("'useFeatureToggleContext' must be used within provider");return e}const c=({children:r})=>{const t=m(import.meta.env.VITE_NAME),{data:n,isLoading:s,isError:p}=i({queryKey:["getFeatureToggleFromAppName"],queryFn:async()=>a.getFeatureToggleFromApplicationName(t)});return s?e(o,{variant:"equinor",withoutScrim:!0}):e(u.Provider,{value:{features:n?.features,isLoading:s,isError:p},children:r})};export{c as default,s as isUserInActiveUserArray,p as useFeatureToggleContext};
@@ -0,0 +1 @@
1
+ import{jsxs as t,Fragment as r,jsx as e}from"react/jsx-runtime";import{useMemo as i}from"react";import{Typography as o,Button as n}from"@equinor/eds-core-react";import{DIALOG_EDGE_MARGIN as a,TUTORIAL_LOCALSTORAGE_VALUE_STRING as l}from"./TutorialProvider.const.js";import{useGetTutorialSasToken as s,useTutorial as m}from"./TutorialProvider.hooks.js";import{DialogImage as c,DialogWrapper as p,StyledTutorialDialog as d,DialogContent as u,DialogActions as g,NavigateSteps as T}from"./TutorialProvider.styles.js";import{getBestPositionWithoutOverlap as h}from"./TutorialProvider.utils.js";import f from"./TutorialStepIndicator.js";import"../../api/core/OpenAPI.js";import{TutorialPosition as v}from"../../api/models/TutorialPosition.js";import"../../api/models/ServiceNowUrgency.js";const P=()=>{const{data:P}=s(),{activeTutorial:x,currentStep:S,setCurrentStep:j,setActiveTutorial:k,dialogRef:y,allElementsToHighlight:O,customStepComponents:$,isLastStep:R,currentStepObject:C,setAllElementsToHighlight:B,shortNameFromParams:E,viewportWidth:I,clearSearchParam:w}=m(),H=i((()=>{if(C)return C.key&&$?$.find((t=>t.key===C.key))?.element:void 0===C.key||null===C.key?t(r,{children:[e(o,{children:C.title}),e(o,{children:C.body}),C.imgUrl&&P&&e(c,{"data-testid":"tutorial-image",alt:"tutorial-image",src:`${C.imgUrl}?${P}`})]}):void 0}),[C,$,P]),L=i((()=>{if(x&&I&&O&&y.current)return x.steps[S].position?x.steps[S].position:x.dynamicPositioning?h(O[S].getBoundingClientRect(),y.current.getBoundingClientRect()):v.BOTTOM_RIGHT}),[x,I,O,y,S]),N=i((()=>{if(L&&L!==v.CENTER)switch(L){case v.TOP_LEFT:return{marginTop:`${a}px`,marginLeft:`${a}px`};case v.TOP_RIGHT:return{marginTop:`${a}px`,marginRight:`${a}px`};case v.BOTTOM_LEFT:return{marginBottom:`${a}px`,marginLeft:`${a}px`};case v.BOTTOM_RIGHT:default:return{marginBottom:`${a}px`,marginRight:`${a}px`}}}),[L]),_=()=>{E&&w(),x&&(window.localStorage.setItem(x?.shortName,l),k(void 0),y.current?.close(),j(0),B(void 0))};return e(p,{children:e(d,{"data-testid":"tutorial-dialog",ref:y,style:N??void 0,children:t(u,{children:[H,e(f,{steps:x?.steps??[],currentStep:S}),t(g,{children:[e(n,{variant:"ghost",onClick:()=>{_()},children:"Skip"}),t(T,{children:[S&&0!==S?e(n,{variant:"ghost",onClick:()=>{j((t=>t-1))},children:"Previous"}):null,e(n,{variant:"outlined",onClick:()=>{R?_():j((t=>t+1))},children:R?"Done":"Next"})]})]})]})})})};export{P as default};
@@ -0,0 +1 @@
1
+ const t=8,o=24,r="tutorial",a="hasCompletedTutorial",e="tutorial-highlighter",i="getTutorialsForApp",l="getTutorialsSasToken";export{o as DIALOG_EDGE_MARGIN,i as GET_TUTORIALS_FOR_APP,l as GET_TUTORIALS_SAS_TOKEN,t as HIGHLIGHT_PADDING,e as TUTORIAL_HIGHLIGHTER_DATATEST_ID,a as TUTORIAL_LOCALSTORAGE_VALUE_STRING,r as TUTORIAL_SEARCH_PARAM_KEY};
@@ -0,0 +1 @@
1
+ import{useContext as r}from"react";import{useQuery as t}from"@tanstack/react-query";import{GET_TUTORIALS_FOR_APP as o,GET_TUTORIALS_SAS_TOKEN as e}from"./TutorialProvider.const.js";import{TutorialService as i}from"../../api/services/TutorialService.js";import{TutorialContext as u}from"./TutorialProvider.js";import{environment as a}from"../../utils/auth_environment.js";const{getAppName:m}=a,n=()=>{const r=m(import.meta.env.VITE_NAME);return t({queryKey:[o,r],queryFn:()=>i.getTutorialsForApplication(r)})},s=()=>t({queryKey:[e],queryFn:()=>i.getTutorialSasToken()}),p=()=>{const t=r(u);if(void 0===t)throw new Error("'useTutorial' must be used within a TutorialProvider");return t};export{s as useGetTutorialSasToken,n as useGetTutorialsForApp,p as useTutorial};
@@ -0,0 +1 @@
1
+ import{jsxs as e,jsx as t}from"react/jsx-runtime";import{createContext as r,useState as o,useRef as i,useMemo as n,useCallback as s,useEffect as l}from"react";import{useSearchParams as a}from"react-router-dom";import{TUTORIAL_SEARCH_PARAM_KEY as u}from"./TutorialProvider.const.js";import{getAllElementsToHighlight as m}from"./TutorialProvider.utils.js";import c from"./TutorialProviderInner.js";const d=r(void 0),h=({children:r,customStepComponents:h,tutorials:p})=>{const[f,v]=o(void 0),[g,w]=o(!1),[y,T]=a(),[P,E]=o(void 0),[S,k]=o(0),[C,j]=o(void 0),[x,F]=o(window.innerWidth),H=i(null),L=n((()=>{if(f)return f.steps.at(S)}),[f,S]),W=n((()=>!!f&&S>=f?.steps.length-1),[f,S]),z=s((()=>{y.delete(u),T(y),E(void 0)}),[y,T]);return l((()=>{if(P)return;const e=y.get(u);e&&E(e)}),[y,P]),l((()=>{const e=()=>{F(window.innerWidth)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]),l((()=>{if(!f||g)return;const e=m(f);e.every((e=>null!==e))?j(e):(async()=>{await new Promise((e=>setTimeout(e,300)));const e=m(f);e.every((e=>null!==e))?j(e):(console.error("Could not find all elements to highlight for the tutorial. \n This is a list of elements that were found for each step: ",e),w(!0))})().catch((e=>{console.error("Error trying to get elements to highlight",e)}))}),[f,S,g,P]),l((()=>{if(!f||g)return;const e=f.steps.filter((e=>void 0!==e.key&&null!==e.key)).map((e=>e.key));if(0===e.length)return;const t=h?.map((e=>e.key));if(!t||0===t.length)return console.error("Could not find any custom components passed to the TutorialProvider \nExpected these keys for the active tutorial: ",e),void w(!0);e.map((e=>t?.includes(e))).some((e=>!0!==e))&&(console.error("Could not find the custom components related to the active tutorial. \n The active tutorial expected to find these keys: ",e,"\n However in the custom components we only found these keys: ",t),w(!0))}),[f,h,g]),e(d.Provider,{value:{currentStepObject:L,activeTutorial:f,setActiveTutorial:v,currentStep:S,setCurrentStep:k,allElementsToHighlight:C,setAllElementsToHighlight:j,customStepComponents:h,isLastStep:W,dialogRef:H,clearSearchParam:z,shortNameFromParams:P,setShortNameFromParams:E,tutorialsFromProps:p??[],tutorialError:g,setTutorialError:w,viewportWidth:x},children:[t(c,{}),r]})};export{d as TutorialContext,h as default};
@@ -0,0 +1,67 @@
1
+ import{Dialog as o}from"@equinor/eds-core-react";import{tokens as i}from"../../node_modules/@equinor/eds-tokens/dist/esm/base/index.js";import t,{keyframes as e}from"styled-components";import{style as n}from"@equinor/amplify-components";const{elevation:a,shape:r}=i,{spacings:d}=n,s=e`
2
+ from {
3
+ box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0);
4
+ }
5
+ to {
6
+ box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.3);
7
+ }
8
+
9
+ `,p=t.div`
10
+ position: absolute;
11
+ z-index: 10000;
12
+ pointer-events: none;
13
+ transition: top, left, width, height;
14
+ transition-duration: 300ms;
15
+ border-radius: 4px;
16
+ animation: ${s} 300ms;
17
+ animation-fill-mode: forwards;
18
+ `,m=t.div`
19
+ position: absolute;
20
+ right: 24px;
21
+ bottom: 24px;
22
+ background: transparent;
23
+ `,l=e`
24
+ from {
25
+ opacity: 0;
26
+ }
27
+ to {
28
+ opacity: 1;
29
+ }
30
+
31
+ `,f=t.dialog`
32
+ border: none;
33
+ box-shadow: ${a.above_scrim};
34
+ border-radius: ${r.corners.borderRadius};
35
+ transition: all;
36
+ transition-duration: 300ms;
37
+ animation: ${l} 300ms;
38
+ animation-fill-mode: forwards;
39
+ &::backdrop {
40
+ background: transparent;
41
+ }
42
+ `,x=t.div`
43
+ display: flex;
44
+ flex-direction: column;
45
+ gap: ${d.large};
46
+ width: 300px;
47
+ `,c=t.img`
48
+ max-height: 300px;
49
+ min-height: 50px;
50
+ object-fit: contain;
51
+ `,b=t.div`
52
+ display: flex;
53
+ justify-content: space-between;
54
+ `,g=t.div`
55
+ display: flex;
56
+ gap: ${d.medium};
57
+ `,u=t(o)`
58
+ width: 300px;
59
+ height: fit-content;
60
+ display: flex;
61
+ flex-direction: column;
62
+ padding: ${d.medium};
63
+ gap: ${d.large};
64
+ button {
65
+ align-self: flex-end;
66
+ }
67
+ `;export{b as DialogActions,x as DialogContent,c as DialogImage,m as DialogWrapper,p as Highlighter,g as NavigateSteps,f as StyledTutorialDialog,u as TutorialErrorDialog};
@@ -0,0 +1 @@
1
+ import{DIALOG_EDGE_MARGIN as T}from"./TutorialProvider.const.js";import"../../api/core/OpenAPI.js";import{TutorialPosition as t}from"../../api/models/TutorialPosition.js";import"../../api/models/ServiceNowUrgency.js";const o=(T,t)=>!(T.top>t.bottom||T.bottom<t.top||T.right<t.left||T.left>t.right),e=(o,e)=>{const i=e===t.BOTTOM_RIGHT||e===t.BOTTOM_LEFT,O=e===t.TOP_RIGHT||e===t.BOTTOM_RIGHT,r=innerWidth-T-o.width,m=innerHeight-T-o.height;return new DOMRect(O?r:T,i?m:T,o.width,o.height)},i=(T,i)=>o(T,e(i,t.BOTTOM_RIGHT))?o(T,e(i,t.BOTTOM_LEFT))?o(T,e(i,t.TOP_RIGHT))?o(T,e(i,t.TOP_LEFT))?t.BOTTOM_RIGHT:t.TOP_LEFT:t.TOP_RIGHT:t.BOTTOM_LEFT:t.BOTTOM_RIGHT,O=T=>T.steps.map(((t,o)=>document.getElementById(`${T.shortName}-${o}`)));export{O as getAllElementsToHighlight,i as getBestPositionWithoutOverlap};
@@ -0,0 +1 @@
1
+ import{jsxs as t,jsx as r,Fragment as o}from"react/jsx-runtime";import{useRef as e,useMemo as i,useCallback as n,useEffect as l}from"react";import{useLocation as a}from"react-router";import{Typography as s,Button as m}from"@equinor/eds-core-react";import h from"./TutorialDialog.js";import{HIGHLIGHT_PADDING as p,TUTORIAL_HIGHLIGHTER_DATATEST_ID as u}from"./TutorialProvider.const.js";import{useTutorial as c,useGetTutorialsForApp as d}from"./TutorialProvider.hooks.js";import{TutorialErrorDialog as f,Highlighter as g}from"./TutorialProvider.styles.js";import{EnvironmentType as w}from"../../types/Environment.js";import{environment as v}from"../../utils/auth_environment.js";const{getEnvironmentName:T}=v,P=()=>{const{pathname:v}=a(),{activeTutorial:P,setActiveTutorial:E,dialogRef:N,allElementsToHighlight:j,shortNameFromParams:x,tutorialError:I,tutorialsFromProps:b,currentStep:C,viewportWidth:k,setTutorialError:R,clearSearchParam:$}=c(),y=e(!1),{data:D}=d(),M=i((()=>{if(!(D||b&&0!==b.length))return[];const t=[];return b&&t.push(...b),D&&t.push(...D),t}),[D,b]),O=i((()=>{if(!j||!P||!k)return;const t=j[C],r=t.getBoundingClientRect();return t&&t.scrollIntoView({behavior:"smooth",block:"center"}),{top:r.top-p+window.scrollY,left:r.left-p,height:r.height+2*p,width:r.width+2*p}}),[P,j,C,k]),S=i((()=>M.filter((t=>t.path===v))),[M,v]),V=n((t=>{y.current||(E(t),y.current=!0)}),[E]);l((()=>{O&&!N.current?.open&&N.current?.showModal()}),[N,O]),l((()=>{if(S.length<1)return;const t=S.find((t=>!window.localStorage.getItem(t.shortName)||x&&S.some((t=>t.shortName===x))));t&&V(t)}),[V,x,S]);const _=()=>{$(),R(!1),E(void 0)};return(P?.showInProd||T(import.meta.env.VITE_ENVIRONMENT_NAME)!==w.PRODUCTION)&&(P?.willPopUp||x)?I&&x?t(f,{open:!0,isDismissable:!0,onClose:_,children:[r(s,{children:"There was a problem starting this tutorial. Please report this in using the feedback function in the Top Bar."}),r(m,{variant:"outlined",onClick:_,children:"Close"})]}):I?null:t(o,{children:[O&&r(g,{"data-testid":u,style:{top:`${O.top}px`,left:`${O.left}px`,width:`${O.width}px`,height:`${O.height}px`}}),r(h,{})]}):null};export{P as default};
@@ -0,0 +1,25 @@
1
+ import{jsx as t}from"react/jsx-runtime";import{tokens as e}from"../../node_modules/@equinor/eds-tokens/dist/esm/base/index.js";import r from"styled-components";const{spacings:i,colors:o}=e,a=r.div`
2
+ position: relative;
3
+ transform: translate(0, -65%);
4
+ display: flex;
5
+ gap: ${i.comfortable.small};
6
+ margin-bottom: -${i.comfortable.small};
7
+ margin-top: ${i.comfortable.medium_small};
8
+ width: 100%;
9
+ justify-content: center;
10
+ `,m=r.div`
11
+ width: ${i.comfortable.medium};
12
+ height: ${i.comfortable.x_small};
13
+ border-radius: 24px;
14
+ transition: all 300ms;
15
+ background: linear-gradient(
16
+ 90deg,
17
+ ${o.interactive.primary__resting.rgba} 49%,
18
+ ${o.interactive.primary__hover_alt.rgba} 51%
19
+ );
20
+
21
+ background-size:
22
+ 400% 10px,
23
+ 400%;
24
+ ${t=>t.$active?"background-position: 0%":`background-position: ${t.$num<t.$activeNum?"-50":"100"}%`}
25
+ `,n=({steps:e,currentStep:r})=>t(a,{children:e.map(((e,i)=>t(m,{$active:i===r,$activeNum:r,$num:i},e.key??e.title)))});export{n as default};
@@ -0,0 +1 @@
1
+ import{jsx as t}from"react/jsx-runtime";import{createContext as r,useContext as o,useState as e,useEffect as s}from"react";const i="tutorialstepscontext",a=()=>{const t=localStorage.getItem(i);return t?JSON.parse(t):{step:"",showTutorialIntro:!1}},n=r(void 0),u=()=>{const t=o(n);if(void 0===t)throw new Error("useTutorialSteps must be used within a TutorialStepsProvider");return t},l=({children:r,startOpen:o=!1})=>{const[u,l]=e(a().step),[p,c]=e(o||a().showTutorialIntro);return s((()=>{var t;t={step:u,showTutorialIntro:p},localStorage.setItem(i,JSON.stringify(t))}),[p,u]),t(n.Provider,{value:{tutorialStep:u,setTutorialStep:l,showTutorialIntro:p,setShowTutorialIntro:c},children:r})};export{l as default,u as useTutorialSteps};
@@ -0,0 +1 @@
1
+ var o;!function(o){o.LOCALHOST="localhost",o.DEVELOP="development",o.STAGING="staging",o.PRODUCTION="production"}(o||(o={}));export{o as EnvironmentType};
@@ -0,0 +1 @@
1
+ var o;!function(o){o.FEATURE="Feature",o.IMPROVEMENT="Improvement",o.BUG_FIX="Bug fix"}(o||(o={}));const E={[o.FEATURE]:{dotColor:"#0084C4"},[o.IMPROVEMENT]:{dotColor:"#FF9200"},[o.BUG_FIX]:{dotColor:"#EB0000"}};export{E as RELEASENOTE_TYPES_INFORMATION,o as ReleaseNoteType};
@@ -0,0 +1 @@
1
+ import{PublicClientApplication as e}from"@azure/msal-browser";import{EnvironmentType as t}from"../types/Environment.js";const o=["IS_MOCK","ALLOWED_PARENT_DOMAINS","SERVICE_NOW_CONFIGURATION_ITEM"],i=e=>{if(!window._env_)return"";if(void 0===window._env_[e]&&!o.includes(e))throw new Error("Missing required environment variable: "+e);return window._env_[e]},n=e=>e||i("CLIENT_ID"),r=e=>e||i("API_SCOPE"),s=e=>void 0!==e&&"true"===e;const E=function(){let e=import.meta.env.VITE_ENVIRONMENT_NAME;return e||(e=i("ENVIRONMENT_NAME")),`https://client-amplify-portal-${e===t.LOCALHOST?t.DEVELOP:e}.radix.equinor.com`}(),a={OPENID:"openid",PROFILE:"profile",USER_READ:"User.Read"},c={scopes:[a.OPENID,a.PROFILE,a.USER_READ]},_={scopes:[a.USER_READ]},I=e=>({scopes:[e]}),A=new e({auth:{clientId:n(import.meta.env.VITE_CLIENT_ID),authority:"https://login.microsoftonline.com/StatoilSRM.onmicrosoft.com/",redirectUri:window.location.origin},cache:{cacheLocation:"localStorage",storeAuthStateInCookie:!1}}),l=(O=import.meta.env.ALLOWED_PARENT_DOMAINS)?O.split(";"):i("ALLOWED_PARENT_DOMAINS")?.split(";")||[];var O;window.addEventListener("message",(async e=>{if(l.includes(e.origin)){const t=e.data;if(t){await A.initialize();try{await A.ssoSilent({sid:t}),console.log("postMessage successfully logged in user!")}catch(e){console.error("Something went wrong with postMessage"),console.error(e)}}}}));const N={fetchMsGraph:(e,t)=>fetch(e,{headers:{Authorization:`Bearer ${t}`}}),GRAPH_SCOPES:a,GRAPH_REQUESTS_LOGIN:c,GRAPH_REQUESTS_PHOTO:_,GRAPH_REQUESTS_BACKEND:I,GRAPH_ENDPOINTS:{PHOTO:"https://graph.microsoft.com/v1.0/me/photos/96x96/$value"},msalApp:A,getToken:async()=>{if(s(import.meta.env.VITE_IS_MOCK))return"";const e=A.getActiveAccount(),t=A.getAllAccounts();if(!e&&0===t.length)return"";return(await A.acquireTokenSilent(I(r(import.meta.env.VITE_API_SCOPE)))).accessToken},isReaderOnly:e=>{if(e){return!e.some((e=>e.includes("WRITE")))}return!0},isInIframe:()=>window.self!==window.top},m={getConfig:i,getAppName:e=>e||i("NAME"),getClientId:n,getApiUrl:e=>e||i("API_URL"),getApiScope:r,getEnvironmentName:e=>e||i("ENVIRONMENT_NAME"),getIsMock:s,getServiceNowConfigurationItem:e=>e||i("SERVICE_NOW_CONFIGURATION_ITEM"),PORTAL_URL_WITHOUT_LOCALHOST:E};export{N as auth,m as environment};
@@ -0,0 +1 @@
1
+ const t=(t,e)=>{const o=localStorage.getItem(t);return o?JSON.parse(o):e},e=(t,e)=>{localStorage.setItem(t,JSON.stringify(e))};export{t as getLocalStorage,e as updateLocalStorage};
@@ -0,0 +1,10 @@
1
+ import type { ApiRequestOptions } from './ApiRequestOptions';
2
+ import type { ApiResult } from './ApiResult';
3
+ export declare class ApiError extends Error {
4
+ readonly url: string;
5
+ readonly status: number;
6
+ readonly statusText: string;
7
+ readonly body: any;
8
+ readonly request: ApiRequestOptions;
9
+ constructor(request: ApiRequestOptions, response: ApiResult, message: string);
10
+ }
@@ -0,0 +1,13 @@
1
+ export type ApiRequestOptions = {
2
+ readonly method: 'GET' | 'PUT' | 'POST' | 'DELETE' | 'OPTIONS' | 'HEAD' | 'PATCH';
3
+ readonly url: string;
4
+ readonly path?: Record<string, any>;
5
+ readonly cookies?: Record<string, any>;
6
+ readonly headers?: Record<string, any>;
7
+ readonly query?: Record<string, any>;
8
+ readonly formData?: Record<string, any>;
9
+ readonly body?: any;
10
+ readonly mediaType?: string;
11
+ readonly responseHeader?: string;
12
+ readonly errors?: Record<number, string>;
13
+ };
@@ -0,0 +1,7 @@
1
+ export type ApiResult = {
2
+ readonly url: string;
3
+ readonly ok: boolean;
4
+ readonly status: number;
5
+ readonly statusText: string;
6
+ readonly body: any;
7
+ };
@@ -0,0 +1,26 @@
1
+ export declare class CancelError extends Error {
2
+ constructor(message: string);
3
+ get isCancelled(): boolean;
4
+ }
5
+ export interface OnCancel {
6
+ readonly isResolved: boolean;
7
+ readonly isRejected: boolean;
8
+ readonly isCancelled: boolean;
9
+ (cancelHandler: () => void): void;
10
+ }
11
+ export declare class CancelablePromise<T> implements Promise<T> {
12
+ readonly [Symbol.toStringTag]: string;
13
+ private _isResolved;
14
+ private _isRejected;
15
+ private _isCancelled;
16
+ private readonly _cancelHandlers;
17
+ private readonly _promise;
18
+ private _resolve?;
19
+ private _reject?;
20
+ constructor(executor: (resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: any) => void, onCancel: OnCancel) => void);
21
+ then<TResult1 = T, TResult2 = never>(onFulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null, onRejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null): Promise<TResult1 | TResult2>;
22
+ catch<TResult = never>(onRejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null): Promise<T | TResult>;
23
+ finally(onFinally?: (() => void) | null): Promise<T>;
24
+ cancel(): void;
25
+ get isCancelled(): boolean;
26
+ }
@@ -0,0 +1,32 @@
1
+ import type { ApiRequestOptions } from './ApiRequestOptions';
2
+ import { CancelablePromise } from 'src/api/core/CancelablePromise';
3
+ type Resolver<T> = (options: ApiRequestOptions) => Promise<T>;
4
+ type Headers = Record<string, string>;
5
+ export type OpenAPIConfig = {
6
+ BASE: string;
7
+ VERSION: string;
8
+ WITH_CREDENTIALS: boolean;
9
+ CREDENTIALS: 'include' | 'omit' | 'same-origin';
10
+ TOKEN?: string | Resolver<string>;
11
+ USERNAME?: string | Resolver<string>;
12
+ PASSWORD?: string | Resolver<string>;
13
+ HEADERS?: Headers | Resolver<Headers>;
14
+ ENCODE_PATH?: (path: string) => string;
15
+ };
16
+ export declare class TokenService {
17
+ /**
18
+ * @returns string Success
19
+ * @throws ApiError
20
+ */
21
+ static getAmplifyPortalToken(): CancelablePromise<string>;
22
+ /**
23
+ * @returns string Success
24
+ * @throws ApiError
25
+ */
26
+ static getAmplifyPortalProductionToken(): CancelablePromise<string>;
27
+ }
28
+ export declare const getPortalToken: () => Promise<string>;
29
+ export declare const OpenAPI: OpenAPIConfig;
30
+ export declare const OpenAPI_Portal: OpenAPIConfig;
31
+ export declare const OpenAPI_Portal_Prod: OpenAPIConfig;
32
+ export {};
@@ -0,0 +1,13 @@
1
+ import type { ApiRequestOptions } from './ApiRequestOptions';
2
+ import { CancelablePromise } from './CancelablePromise';
3
+ import type { OnCancel } from './CancelablePromise';
4
+ import type { OpenAPIConfig } from './OpenAPI';
5
+ export declare const sendRequest: (config: OpenAPIConfig, options: ApiRequestOptions, url: string, body: any, formData: FormData | undefined, headers: Headers, onCancel: OnCancel) => Promise<XMLHttpRequest>;
6
+ /**
7
+ * Request method
8
+ * @param config The OpenAPI configuration object
9
+ * @param options The request options from the service
10
+ * @returns CancelablePromise<T>
11
+ * @throws ApiError
12
+ */
13
+ export declare const request: <T>(config: OpenAPIConfig, options: ApiRequestOptions) => CancelablePromise<T>;
@@ -0,0 +1,15 @@
1
+ export { ApiError } from './core/ApiError';
2
+ export { CancelablePromise, CancelError } from './core/CancelablePromise';
3
+ export { OpenAPI } from './core/OpenAPI';
4
+ export { request } from './core/request';
5
+ export type { OpenAPIConfig } from './core/OpenAPI';
6
+ export type { Feature } from './models/Feature';
7
+ export type { CustomTutorialStep } from './models/CustomTutorialStep';
8
+ export type { GenericTutorialStep } from './models/GenericTutorialStep';
9
+ export type { Tutorial } from './models/Tutorial';
10
+ export type { FeatureToggleDto } from './models/FeatureToggleDto';
11
+ export type { GraphUser } from './models/GraphUser';
12
+ export type { ServiceNowIncidentResponse } from './models/ServiceNowIncidentResponse';
13
+ export type { ServiceNowIncidentAttachmentResponse } from './models/ServiceNowIncidentAttachmentResponse';
14
+ export { TutorialPosition } from './models/TutorialPosition';
15
+ export { ServiceNowUrgency } from './models/ServiceNowUrgency';
@@ -0,0 +1,4 @@
1
+ export type AccessRoles = {
2
+ role: string;
3
+ description: string;
4
+ };
@@ -0,0 +1,17 @@
1
+ import { AccessRoles } from './AccessRole';
2
+ export type AmplifyApplication = {
3
+ id: string;
4
+ name: string;
5
+ adGroups: Array<string>;
6
+ url: string;
7
+ accessRoles: Array<AccessRoles>;
8
+ description: string;
9
+ longDescription: string;
10
+ category: string;
11
+ version: string;
12
+ applicationInsightAPI: string;
13
+ apI_Id: string;
14
+ apiurl: string;
15
+ monitored: boolean;
16
+ productOwners: Array<string>;
17
+ };
@@ -0,0 +1,4 @@
1
+ import { TutorialStepBase } from './TutorialStepBase';
2
+ export type CustomTutorialStep = TutorialStepBase & {
3
+ key: string;
4
+ };
@@ -0,0 +1,8 @@
1
+ import type { GraphUser } from './GraphUser';
2
+ export type Feature = {
3
+ uuid: string;
4
+ featureKey: string;
5
+ description: string;
6
+ activeUsers: Array<GraphUser>;
7
+ activeEnvironments: Array<string>;
8
+ };
@@ -0,0 +1,5 @@
1
+ import type { Feature } from './Feature';
2
+ export type FeatureToggleDto = {
3
+ applicationName: string;
4
+ features: Array<Feature>;
5
+ };
@@ -0,0 +1,7 @@
1
+ import { TutorialStepBase } from './TutorialStepBase';
2
+ export type GenericTutorialStep = TutorialStepBase & {
3
+ title: string;
4
+ body: string;
5
+ key?: undefined;
6
+ imgUrl?: string;
7
+ };
@@ -0,0 +1,6 @@
1
+ export type GraphUser = {
2
+ id: string;
3
+ displayName: string;
4
+ mail: string;
5
+ userPrincipalName: string;
6
+ };
@@ -0,0 +1,9 @@
1
+ export type ReleaseNote = {
2
+ releaseId?: string | null;
3
+ applicationName?: string | null;
4
+ version?: string | null;
5
+ title?: string | null;
6
+ body?: string | null;
7
+ tags?: Array<string> | null;
8
+ createdDate?: string;
9
+ };
@@ -0,0 +1,8 @@
1
+ export type ReleaseNotePatch = {
2
+ releaseId?: string;
3
+ applicationName?: string | null;
4
+ version?: string | null;
5
+ title?: string | null;
6
+ body?: string | null;
7
+ tags?: Array<string> | null;
8
+ };
@@ -0,0 +1,7 @@
1
+ export type ServiceNowIncidentAttachmentResponse = {
2
+ tableName?: string | null;
3
+ tableSysId?: string | null;
4
+ sysId?: string | null;
5
+ contentType?: string | null;
6
+ fileName?: string | null;
7
+ };
@@ -0,0 +1,13 @@
1
+ import type { ServiceNowIncidentAttachmentResponse } from './ServiceNowIncidentAttachmentResponse';
2
+ export type ServiceNowIncidentResponse = {
3
+ number?: string | null;
4
+ assignmentGroup?: string | null;
5
+ configurationItem?: string | null;
6
+ title?: string | null;
7
+ description?: string | null;
8
+ caller?: string | null;
9
+ state?: string | null;
10
+ urgency?: string | null;
11
+ sysId?: string | null;
12
+ attachmentResponse?: ServiceNowIncidentAttachmentResponse;
13
+ };