@beinformed/ui 2.0.0-beta.0 → 2.0.0-beta.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 (90) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/{Constants-BIbEko1E.d.cts → Constants-Cw7d8vue.d.cts} +7 -2
  3. package/dist/{Constants-BIbEko1E.d.ts → Constants-Cw7d8vue.d.ts} +7 -2
  4. package/dist/{FormModel-40md7nLX.d.ts → FormModel-DnizzHJs.d.cts} +8 -14
  5. package/dist/{FormModel-CemlQ_MU.d.cts → FormModel-VQaB1SCS.d.ts} +8 -14
  6. package/dist/chunk-333J3Q2L.js +2 -0
  7. package/dist/chunk-333J3Q2L.js.map +1 -0
  8. package/dist/chunk-5BR5HMNQ.js +2 -0
  9. package/dist/chunk-5BR5HMNQ.js.map +1 -0
  10. package/dist/chunk-6GV6KLAV.js +2 -0
  11. package/dist/chunk-6GV6KLAV.js.map +1 -0
  12. package/dist/{chunk-CKI2GSM7.js → chunk-BTDN4ZDB.js} +2 -2
  13. package/dist/{chunk-CKI2GSM7.js.map → chunk-BTDN4ZDB.js.map} +1 -1
  14. package/dist/chunk-KCZQQTX6.js +2 -0
  15. package/dist/chunk-KCZQQTX6.js.map +1 -0
  16. package/dist/chunk-LCMAAW7B.js +2 -0
  17. package/dist/chunk-LCMAAW7B.js.map +1 -0
  18. package/dist/{chunk-LYBG43T6.js → chunk-OBB3YOFC.js} +2 -2
  19. package/dist/{chunk-LYBG43T6.js.map → chunk-OBB3YOFC.js.map} +1 -1
  20. package/dist/chunk-QIGFPQFN.js +1 -0
  21. package/dist/chunk-UE323PGR.js +2 -0
  22. package/dist/{chunk-LHZG2ET5.js.map → chunk-UE323PGR.js.map} +1 -1
  23. package/dist/chunk-VIKUDFQV.js +33 -0
  24. package/dist/chunk-VIKUDFQV.js.map +1 -0
  25. package/dist/{chunk-MQBYZKME.js → chunk-YOBCFXEM.js} +2 -2
  26. package/dist/chunk-ZDZHA43Q.js +2 -0
  27. package/dist/chunk-ZDZHA43Q.js.map +1 -0
  28. package/dist/constants/index.cjs +1 -1
  29. package/dist/constants/index.cjs.map +1 -1
  30. package/dist/constants/index.d.cts +1 -1
  31. package/dist/constants/index.d.ts +1 -1
  32. package/dist/constants/index.js +1 -1
  33. package/dist/exceptions/index.cjs +1 -1
  34. package/dist/exceptions/index.cjs.map +1 -1
  35. package/dist/exceptions/index.d.cts +3 -3
  36. package/dist/exceptions/index.d.ts +3 -3
  37. package/dist/exceptions/index.js +1 -1
  38. package/dist/{index-CgXDAyxM.d.ts → index-BFD-cKUB.d.cts} +202 -115
  39. package/dist/{index-Ku2WDvSe.d.cts → index-CEg8Nt57.d.ts} +202 -115
  40. package/dist/index.cjs +8 -8
  41. package/dist/index.cjs.map +1 -1
  42. package/dist/index.d.cts +6 -6
  43. package/dist/index.d.ts +6 -6
  44. package/dist/index.js +1 -1
  45. package/dist/layouthints/index.cjs +5 -5
  46. package/dist/layouthints/index.cjs.map +1 -1
  47. package/dist/layouthints/index.d.cts +2 -2
  48. package/dist/layouthints/index.d.ts +2 -2
  49. package/dist/layouthints/index.js +1 -1
  50. package/dist/models/index.cjs +10 -10
  51. package/dist/models/index.cjs.map +1 -1
  52. package/dist/models/index.d.cts +53 -76
  53. package/dist/models/index.d.ts +53 -76
  54. package/dist/models/index.js +1 -1
  55. package/dist/modularui/index.cjs +10 -10
  56. package/dist/modularui/index.cjs.map +1 -1
  57. package/dist/modularui/index.d.cts +47 -8
  58. package/dist/modularui/index.d.ts +47 -8
  59. package/dist/modularui/index.js +1 -1
  60. package/dist/settings/index.cjs +1 -1
  61. package/dist/settings/index.cjs.map +1 -1
  62. package/dist/settings/index.d.cts +1 -3
  63. package/dist/settings/index.d.ts +1 -3
  64. package/dist/settings/index.js +1 -1
  65. package/dist/types/index.d.cts +2 -2
  66. package/dist/types/index.d.ts +2 -2
  67. package/dist/utils/index.cjs +12 -12
  68. package/dist/utils/index.cjs.map +1 -1
  69. package/dist/utils/index.d.cts +7 -5
  70. package/dist/utils/index.d.ts +7 -5
  71. package/dist/utils/index.js +1 -1
  72. package/package.json +7 -7
  73. package/dist/chunk-52QS5IDA.js +0 -1
  74. package/dist/chunk-77CGPEAQ.js +0 -2
  75. package/dist/chunk-77CGPEAQ.js.map +0 -1
  76. package/dist/chunk-BE2T4IDL.js +0 -2
  77. package/dist/chunk-BE2T4IDL.js.map +0 -1
  78. package/dist/chunk-BODVDNNA.js +0 -2
  79. package/dist/chunk-BODVDNNA.js.map +0 -1
  80. package/dist/chunk-EP2OYSVS.js +0 -2
  81. package/dist/chunk-EP2OYSVS.js.map +0 -1
  82. package/dist/chunk-FGEQKEJQ.js +0 -2
  83. package/dist/chunk-FGEQKEJQ.js.map +0 -1
  84. package/dist/chunk-LHZG2ET5.js +0 -2
  85. package/dist/chunk-SGXACUOV.js +0 -2
  86. package/dist/chunk-SGXACUOV.js.map +0 -1
  87. package/dist/chunk-YUOGIFZH.js +0 -33
  88. package/dist/chunk-YUOGIFZH.js.map +0 -1
  89. /package/dist/{chunk-52QS5IDA.js.map → chunk-QIGFPQFN.js.map} +0 -0
  90. /package/dist/{chunk-MQBYZKME.js.map → chunk-YOBCFXEM.js.map} +0 -0
@@ -1,6 +1,6 @@
1
- import { db as RequestOptions, c8 as Href, aQ as SectionFragment, cV as ISO_DATE, cZ as HistoryLocation, d1 as ErrorMessage, c$ as TextWithPlaceholders, a9 as MaybeAttributeValue } from '../index-Ku2WDvSe.cjs';
2
- export { d7 as BaseDateTimeUtil, d3 as DateTimeUtil, d2 as DateUtil, dd as ModularUIRequestOptions, d6 as OffsetInfo, d9 as ProgressHandler, da as RequestBaseOptions, d8 as RequestURLOptions, d4 as TimeUtil, d5 as TimestampUtil, dc as UpdateHandler } from '../index-Ku2WDvSe.cjs';
3
- import '../Constants-BIbEko1E.cjs';
1
+ import { dd as RequestOptions, c8 as Href, aQ as SectionFragment, c_ as HrefState, cW as ISO_DATE, c$ as HistoryLocation, d3 as ErrorMessage, d1 as TextWithPlaceholders, a9 as MaybeAttributeValue } from '../index-BFD-cKUB.cjs';
2
+ export { d9 as BaseDateTimeUtil, d5 as DateTimeUtil, d4 as DateUtil, df as ModularUIRequestOptions, d8 as OffsetInfo, db as ProgressHandler, dc as RequestBaseOptions, da as RequestURLOptions, d6 as TimeUtil, d7 as TimestampUtil, de as UpdateHandler } from '../index-BFD-cKUB.cjs';
3
+ import '../Constants-Cw7d8vue.cjs';
4
4
  import 'immer';
5
5
  import '@date-fns/tz/date';
6
6
  import 'date-fns';
@@ -38,11 +38,13 @@ declare const parseUrl: (href: string | Href) => {
38
38
  querystring: undefined | string;
39
39
  hash: undefined | string;
40
40
  };
41
- declare const filterParameters: (href: string | Href, allowedParameters?: string[]) => Href<unknown>;
41
+ declare const filterParameters: (href: string | Href, allowedParameters?: string[]) => Href<HrefState>;
42
42
  declare const createHref: (context: string, dynamicPart: string | Href, entryDate?: ISO_DATE, location?: HistoryLocation, allowedParameters?: string[]) => Href;
43
43
 
44
44
  declare const createUUID: () => string;
45
45
 
46
+ declare const IS_DEV: boolean;
47
+
46
48
  /**
47
49
  * Creates an url to a resource in the Be Informed repository
48
50
  * Only possible when serving using the UI Servlet of Be Informed
@@ -180,4 +182,4 @@ declare const getCookie: (name: string) => string | undefined;
180
182
  declare const setCookie: (name: string, value: string, options?: CookieOptions) => void;
181
183
  declare const clearCookie: (name: string) => void;
182
184
 
183
- export { cacheInstance as Cache, type CacheType, DecimalFormat, NumberUtil, RequestOptions, clearCookie, createHash, createHashFromHref, createHref, createUUID, filterParameters, getCookie, getRepositoryResourceUrl, graalFetch, parseUrl, removeUnwantedHtml, resourceExists, resourceRedirectsToSecureLogin, retrieveText, setCookie, universalFetch, xhr };
185
+ export { cacheInstance as Cache, type CacheType, DecimalFormat, IS_DEV, NumberUtil, RequestOptions, clearCookie, createHash, createHashFromHref, createHref, createUUID, filterParameters, getCookie, getRepositoryResourceUrl, graalFetch, parseUrl, removeUnwantedHtml, resourceExists, resourceRedirectsToSecureLogin, retrieveText, setCookie, universalFetch, xhr };
@@ -1,6 +1,6 @@
1
- import { db as RequestOptions, c8 as Href, aQ as SectionFragment, cV as ISO_DATE, cZ as HistoryLocation, d1 as ErrorMessage, c$ as TextWithPlaceholders, a9 as MaybeAttributeValue } from '../index-CgXDAyxM.js';
2
- export { d7 as BaseDateTimeUtil, d3 as DateTimeUtil, d2 as DateUtil, dd as ModularUIRequestOptions, d6 as OffsetInfo, d9 as ProgressHandler, da as RequestBaseOptions, d8 as RequestURLOptions, d4 as TimeUtil, d5 as TimestampUtil, dc as UpdateHandler } from '../index-CgXDAyxM.js';
3
- import '../Constants-BIbEko1E.js';
1
+ import { dd as RequestOptions, c8 as Href, aQ as SectionFragment, c_ as HrefState, cW as ISO_DATE, c$ as HistoryLocation, d3 as ErrorMessage, d1 as TextWithPlaceholders, a9 as MaybeAttributeValue } from '../index-CEg8Nt57.js';
2
+ export { d9 as BaseDateTimeUtil, d5 as DateTimeUtil, d4 as DateUtil, df as ModularUIRequestOptions, d8 as OffsetInfo, db as ProgressHandler, dc as RequestBaseOptions, da as RequestURLOptions, d6 as TimeUtil, d7 as TimestampUtil, de as UpdateHandler } from '../index-CEg8Nt57.js';
3
+ import '../Constants-Cw7d8vue.js';
4
4
  import 'immer';
5
5
  import '@date-fns/tz/date';
6
6
  import 'date-fns';
@@ -38,11 +38,13 @@ declare const parseUrl: (href: string | Href) => {
38
38
  querystring: undefined | string;
39
39
  hash: undefined | string;
40
40
  };
41
- declare const filterParameters: (href: string | Href, allowedParameters?: string[]) => Href<unknown>;
41
+ declare const filterParameters: (href: string | Href, allowedParameters?: string[]) => Href<HrefState>;
42
42
  declare const createHref: (context: string, dynamicPart: string | Href, entryDate?: ISO_DATE, location?: HistoryLocation, allowedParameters?: string[]) => Href;
43
43
 
44
44
  declare const createUUID: () => string;
45
45
 
46
+ declare const IS_DEV: boolean;
47
+
46
48
  /**
47
49
  * Creates an url to a resource in the Be Informed repository
48
50
  * Only possible when serving using the UI Servlet of Be Informed
@@ -180,4 +182,4 @@ declare const getCookie: (name: string) => string | undefined;
180
182
  declare const setCookie: (name: string, value: string, options?: CookieOptions) => void;
181
183
  declare const clearCookie: (name: string) => void;
182
184
 
183
- export { cacheInstance as Cache, type CacheType, DecimalFormat, NumberUtil, RequestOptions, clearCookie, createHash, createHashFromHref, createHref, createUUID, filterParameters, getCookie, getRepositoryResourceUrl, graalFetch, parseUrl, removeUnwantedHtml, resourceExists, resourceRedirectsToSecureLogin, retrieveText, setCookie, universalFetch, xhr };
185
+ export { cacheInstance as Cache, type CacheType, DecimalFormat, IS_DEV, NumberUtil, RequestOptions, clearCookie, createHash, createHashFromHref, createHref, createUUID, filterParameters, getCookie, getRepositoryResourceUrl, graalFetch, parseUrl, removeUnwantedHtml, resourceExists, resourceRedirectsToSecureLogin, retrieveText, setCookie, universalFetch, xhr };
@@ -1,2 +1,2 @@
1
- import{a as r,b as s,c as t,d as u,e as v,f as w,g as x,h as y}from"../chunk-EP2OYSVS.js";import{a as b,b as c,c as d}from"../chunk-CKI2GSM7.js";import"../chunk-FGEQKEJQ.js";import{b as e,c as f,d as g,e as h,f as i,g as j,h as k,i as l,m,n,o,p,q}from"../chunk-BODVDNNA.js";import{b as a}from"../chunk-YUOGIFZH.js";import"../chunk-VGAPPKHA.js";import"../chunk-LYBG43T6.js";import"../chunk-WVQSFYWD.js";import"../chunk-LHZG2ET5.js";import"../chunk-77CGPEAQ.js";export{h as BaseDateTimeUtil,a as Cache,j as DateTimeUtil,i as DateUtil,p as DecimalFormat,q as NumberUtil,k as TimeUtil,l as TimestampUtil,g as clearCookie,m as createHash,n as createHashFromHref,v as createHref,w as createUUID,u as filterParameters,e as getCookie,x as getRepositoryResourceUrl,b as graalFetch,t as parseUrl,y as removeUnwantedHtml,r as resourceExists,s as resourceRedirectsToSecureLogin,o as retrieveText,f as setCookie,d as universalFetch,c as xhr};
1
+ import{a as r,b as s,c as t,d as u,e as v,f as w,g as x,h as y,i as z}from"../chunk-ZDZHA43Q.js";import{a as b,b as c,c as d}from"../chunk-BTDN4ZDB.js";import"../chunk-333J3Q2L.js";import{b as e,c as f,d as g,e as h,f as i,g as j,h as k,i as l,m,n,o,p,q}from"../chunk-KCZQQTX6.js";import{b as a}from"../chunk-VIKUDFQV.js";import"../chunk-VGAPPKHA.js";import"../chunk-OBB3YOFC.js";import"../chunk-WVQSFYWD.js";import"../chunk-UE323PGR.js";import"../chunk-6GV6KLAV.js";export{h as BaseDateTimeUtil,a as Cache,j as DateTimeUtil,i as DateUtil,p as DecimalFormat,x as IS_DEV,q as NumberUtil,k as TimeUtil,l as TimestampUtil,g as clearCookie,m as createHash,n as createHashFromHref,v as createHref,w as createUUID,u as filterParameters,e as getCookie,y as getRepositoryResourceUrl,b as graalFetch,t as parseUrl,z as removeUnwantedHtml,r as resourceExists,s as resourceRedirectsToSecureLogin,o as retrieveText,f as setCookie,d as universalFetch,c as xhr};
2
2
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@beinformed/ui",
3
- "version": "2.0.0-beta.0",
3
+ "version": "2.0.0-beta.1",
4
4
  "description": "Be Informed UI core",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -15,14 +15,14 @@
15
15
  "date-fns": "^4.0.0"
16
16
  },
17
17
  "dependencies": {
18
- "@date-fns/tz": "^1.2.0",
18
+ "@date-fns/tz": "^1.4.1",
19
19
  "big.js": "^7.0.1",
20
20
  "deepmerge": "^4.3.1",
21
21
  "file-size": "^1.0.0",
22
- "hash-it": "^6.0.0",
22
+ "hash-it": "^7.0.2",
23
23
  "html-entities": "^2.6.0",
24
24
  "iban": "^0.0.14",
25
- "immer": "^10.1.1",
25
+ "immer": "^11.1.3",
26
26
  "js-cookie": "^3.0.5",
27
27
  "klona": "^2.0.6",
28
28
  "timezone-soft": "^1.5.2"
@@ -33,7 +33,7 @@
33
33
  "@types/iban": "^0.0.35",
34
34
  "@types/js-cookie": "^3.0.6",
35
35
  "date-fns": "^4.1.0",
36
- "msw": "^2.10.4",
36
+ "msw": "^2.12.8",
37
37
  "@beinformed/typescript-config": "0.0.0"
38
38
  },
39
39
  "exports": {
@@ -94,11 +94,11 @@
94
94
  "build": "tsup",
95
95
  "clean:build": "rimraf ./dist",
96
96
  "lint": "eslint .",
97
- "lint:ci": "eslint . --ext .ts,.tsx --format junit -o ../../reports/eslint-report-core.xml",
97
+ "lint:ci": "eslint . --ext .ts,.tsx --format junit -o ./reports/eslint-report-ui.xml",
98
98
  "lint:fix": "pnpm lint --fix",
99
99
  "prettier": "prettier --write .",
100
100
  "test": "vitest run",
101
- "test:ci": "vitest run --reporter=junit --outputFile=../../reports/vitest-report-core.xml",
101
+ "test:ci": "vitest run --reporter=junit --outputFile=./reports/vitest-report-ui.xml",
102
102
  "typecheck": "tsc --noEmit",
103
103
  "createIndex": "node ./createIndex.mjs ./src"
104
104
  }
@@ -1 +0,0 @@
1
- //# sourceMappingURL=chunk-52QS5IDA.js.map
@@ -1,2 +0,0 @@
1
- var _=Object.create;var S=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var M=Object.getPrototypeOf,x=Object.prototype.hasOwnProperty;var R=(o,t)=>()=>(t||o((t={exports:{}}).exports,t),t.exports);var p=(o,t,e,A)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of s(t))!x.call(o,n)&&n!==e&&S(o,n,{get:()=>t[n],enumerable:!(A=E(t,n))||A.enumerable});return o};var T=(o,t,e)=>(e=o!=null?_(M(o)):{},p(t||!o||!o.__esModule?S(e,"default",{value:o,enumerable:!0}):e,o));var c=typeof Graal<"u",y=c,O=(e=>(e.GET="GET",e.POST="POST",e))(O||{}),L="~",a="entryDate",l="yyyy-MM-dd",G="yyyy-MM-dd'T'HH:mm:ss",u="HH:mm:ss",C="yyyy-MM-dd'T'HH:mm:ss.SSS",I="xxx",d=1,P=1,m=(r=>(r.EXTRA_SMALL="EXTRA_SMALL",r.SMALL="SMALL",r.MEDIUM="MEDIUM",r.LARGE="LARGE",r.EXTRA_LARGE="EXTRA_LARGE",r))(m||{}),F=(A=>(A.JAAS="JAAS",A.PAC4J_FORM="PAC4J_FORM",A.PAC4J_BASIC="PAC4J_BASIC",A))(F||{}),J="security.clients",N="FormClient.login_url",f="FormClient.username_field_name",D="FormClient.password_field_name",X="FormClient.logout_url",U={name:"Form based authentication",authentication:"DefaultFormClient",isPrimary:!0};export{R as a,T as b,c,y as d,O as e,L as f,a as g,l as h,G as i,u as j,C as k,I as l,d as m,P as n,m as o,F as p,J as q,N as r,f as s,D as t,X as u,U as v};
2
- //# sourceMappingURL=chunk-77CGPEAQ.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/constants/Constants.ts"],"sourcesContent":["export const IS_GRAALJS = typeof Graal !== \"undefined\";\nexport const IS_SERVER = IS_GRAALJS;\n\nexport enum HTTP_METHODS {\n GET = \"GET\",\n POST = \"POST\",\n}\n\n/**\n * Separator for parameters of a list, makes it possible to render multiple lists on a page in a non-js environment\n */\nexport const PARAMETER_SEPARATOR = \"~\";\n\n/**\n * Timeversion filter name\n */\nexport const TIMEVERSION_FILTER_NAME = \"entryDate\";\n\nexport const ISO_DATE_FORMAT = \"yyyy-MM-dd\";\nexport const ISO_DATETIME_FORMAT = \"yyyy-MM-dd'T'HH:mm:ss\";\nexport const ISO_TIME_FORMAT = \"HH:mm:ss\";\nexport const ISO_TIMESTAMP_FORMAT = \"yyyy-MM-dd'T'HH:mm:ss.SSS\";\n\n/**\n * Offset format is appended to iso datetime and timestamp when isIncludeTimeOffsetInDateTimes = true\n */\nexport const DATETIME_OFFSET_FORMAT = \"xxx\";\n\n/**\n * week starts on monday by default\n */\nexport const DEFAULT_WEEK_STARTS_ON = 1;\n\n/**\n * first week indicated by the 1st of january\n */\nexport const DEFAULT_FIRST_WEEK_CONTAINS_DATE = 1;\n\n/**\n * ATTRIBUTE WIDTH\n */\nexport enum ATTRIBUTE_WIDTH {\n EXTRA_SMALL = \"EXTRA_SMALL\",\n SMALL = \"SMALL\",\n MEDIUM = \"MEDIUM\",\n LARGE = \"LARGE\",\n EXTRA_LARGE = \"EXTRA_LARGE\",\n}\n\nexport enum INTERNAL_LOGIN_TYPE {\n JAAS = \"JAAS\",\n PAC4J_FORM = \"PAC4J_FORM\",\n PAC4J_BASIC = \"PAC4J_BASIC\",\n}\n\nexport const LOGIN_TYPE = \"security.clients\";\nexport const LOGIN_PATH_SETTING = \"FormClient.login_url\";\nexport const LOGIN_USERNAME_SETTING = \"FormClient.username_field_name\";\nexport const LOGIN_PASSWORD_SETTING = \"FormClient.password_field_name\";\nexport const LOGOUT_PATH_SETTING = \"FormClient.logout_url\";\n\nexport const DEFAULT_AUTHENTICATION_TYPE = {\n name: \"Form based authentication\",\n authentication: \"DefaultFormClient\",\n isPrimary: true,\n};\n"],"mappings":"ygBAAO,IAAMA,EAAa,OAAO,MAAU,IAC9BC,EAAYD,EAEbE,OACVA,EAAA,IAAM,MACNA,EAAA,KAAO,OAFGA,OAAA,IAQCC,EAAsB,IAKtBC,EAA0B,YAE1BC,EAAkB,aAClBC,EAAsB,wBACtBC,EAAkB,WAClBC,EAAuB,4BAKvBC,EAAyB,MAKzBC,EAAyB,EAKzBC,EAAmC,EAKpCC,OACVA,EAAA,YAAc,cACdA,EAAA,MAAQ,QACRA,EAAA,OAAS,SACTA,EAAA,MAAQ,QACRA,EAAA,YAAc,cALJA,OAAA,IAQAC,OACVA,EAAA,KAAO,OACPA,EAAA,WAAa,aACbA,EAAA,YAAc,cAHJA,OAAA,IAMCC,EAAa,mBACbC,EAAqB,uBACrBC,EAAyB,iCACzBC,EAAyB,iCACzBC,EAAsB,wBAEtBC,EAA8B,CACzC,KAAM,4BACN,eAAgB,oBAChB,UAAW,EACb","names":["IS_GRAALJS","IS_SERVER","HTTP_METHODS","PARAMETER_SEPARATOR","TIMEVERSION_FILTER_NAME","ISO_DATE_FORMAT","ISO_DATETIME_FORMAT","ISO_TIME_FORMAT","ISO_TIMESTAMP_FORMAT","DATETIME_OFFSET_FORMAT","DEFAULT_WEEK_STARTS_ON","DEFAULT_FIRST_WEEK_CONTAINS_DATE","ATTRIBUTE_WIDTH","INTERNAL_LOGIN_TYPE","LOGIN_TYPE","LOGIN_PATH_SETTING","LOGIN_USERNAME_SETTING","LOGIN_PASSWORD_SETTING","LOGOUT_PATH_SETTING","DEFAULT_AUTHENTICATION_TYPE"]}
@@ -1,2 +0,0 @@
1
- import{a as H}from"./chunk-MQBYZKME.js";import{b as g,c as s}from"./chunk-CKI2GSM7.js";import{f as w}from"./chunk-FGEQKEJQ.js";import{Xa as k,bb as S,db as m,e as P,j as v,x as O,zb as D}from"./chunk-SGXACUOV.js";import{l as R}from"./chunk-BODVDNNA.js";import{a as q,b as p}from"./chunk-YUOGIFZH.js";import{a as h}from"./chunk-VGAPPKHA.js";import{A as C,h as y,o as b,p as M,q as E,r as A,s as F,v as l,w as c}from"./chunk-LYBG43T6.js";import{g as f}from"./chunk-LHZG2ET5.js";import{b as j,g as x,p as I}from"./chunk-77CGPEAQ.js";var L=class{_isBasicAuthentication;_authenticationType;constructor(){this._isBasicAuthentication=!1,this._authenticationType=this.getAuthenticationType()}getAuthenticationType(){let t=b(),e=I[t];if(!e||e==="JAAS")return"JAAS";if(e==="PAC4J_FORM"||t.includes("FormClient"))return"PAC4J_FORM";if(e==="PAC4J_BASIC"||t.includes("BasicClient"))return"PAC4J_BASIC";throw new Error(`Unsupported login type found: ${t}`)}get authenticationType(){return this._authenticationType}set authenticationType(t){this._authenticationType=t}get isBasicAuthentication(){return this._isBasicAuthentication||this.authenticationType==="PAC4J_BASIC"}set isBasicAuthentication(t){this._isBasicAuthentication=t}requestLogin(){return s({url:`${l()}/login`,method:"GET",headers:{Accept:"application/json","Content-Type":"application/x-www-form-urlencoded"}})}initLogin(t){return this.isBasicAuthentication||!t?Promise.resolve(!0):this.requestLogin().catch(e=>(e instanceof w&&(this.isBasicAuthentication=!0),Promise.resolve({})))}login(t,e){switch(this.authenticationType){case"PAC4J_FORM":return this.doFormLogin(t,e);case"PAC4J_BASIC":return this.doBasicAuthentication(t,e);default:return this.doJaasAuthentication(t,e)}}getFormLoginUrl(){switch(this.authenticationType){case"PAC4J_BASIC":return`${l()}${M("DirectBasicAuthClient")}`;case"PAC4J_FORM":return`${l()}${M("FormClient")}`;default:return`${l()}/j_security_check`}}getFormLoginData(t,e){let i=encodeURIComponent(t),r=encodeURIComponent(e);switch(this.authenticationType){case"PAC4J_BASIC":case"PAC4J_FORM":return`${E()}=${i}&${A()}=${r}`;default:return`j_username=${i}&j_password=${r}`}}doFormLogin(t,e){return s({url:this.getFormLoginUrl(),method:"POST",headers:{Accept:"application/json","Content-Type":"application/x-www-form-urlencoded"},data:this.getFormLoginData(t,e)})}doBasicAuthentication(t,e){return p.addItem("basic",btoa(`${t}:${e}`)),this.requestLogin()}doJaasAuthentication(t,e){return this.initLogin(!0).then(()=>this.isBasicAuthentication?(p.removeItem("basic-ok"),this.doBasicAuthentication(t,e).then(()=>{p.addItem("basic-ok",!0)})):this.doFormLogin(t,e))}getLogoutUrl(){switch(this.authenticationType){case"PAC4J_BASIC":case"PAC4J_FORM":return`${l()}${F()}`;default:return`${l()}/Logoff`}}logout(){return s({url:this.getLogoutUrl()}).then(t=>(p.clear(),t))}};var U=class{_tokenId;_image;_origin="";_contextPath=c();CaptchaRequest(t){this._origin=t?.origin||"",this._contextPath=t?.contextPath||c()}captchaResponse(t){return this._tokenId="tokenId"in t?t.tokenId:this._tokenId,this._image="image"in t?t.image:this._image,{tokenId:this._tokenId,image:this._image,valid:"valid"in t?t.valid:!1,error:"error"in t?t.error:null}}init(){return g({url:C(this._contextPath,this._origin)}).then(t=>this.captchaResponse(t))}send(t){return g({url:C(this._contextPath,this._origin),method:"POST",data:{tokenId:this._tokenId??"",answer:t??""}}).then(e=>this.captchaResponse(e)).catch(e=>this.captchaResponse(e.response))}refresh(){return this.init()}};var u=class n extends Error{response;href;constructor(t,e,i){super(t),this.response=e,this.href=i,Error.captureStackTrace&&Error.captureStackTrace(this,n)}get resource(){return this.href}};var N=j(q(),1);import J from"deepmerge";import{klona as B}from"klona/full";var $=class n{_response=new P;_href;_options;_targetModel;_forceTargetModel=!1;_contributionsHref;_locale="en";_method="GET";_progressEvent;_origin="";_contextPath=c();_layoutHintProcessor;constructor(t,e={}){if(!t)throw new h("You must pass a href to the resource that is requested");this._href=typeof t=="string"?new R(t):t,this._options=e,this._layoutHintProcessor=new H(this._origin,this._contextPath,this.options),this._response=new P,this._response.requestHref=this.href,this.locale=this.getRequestLocale(e.locale),this._response.parameters=this.href.parameters.all,this.contextPath=e.contextPath||this.href.contextPath,this.origin=e.origin||this.href.origin,this._targetModel=e.targetModel,this.method=e.method||this.href.method}getRequestLocale(t){return t||typeof navigator<"u"&&navigator?.language&&navigator.language.split("-")[0]||"en"}get origin(){return this._origin}set origin(t){this._origin=t??"",this._response.origin=t??"",this._layoutHintProcessor.setOrigin(this._origin)}get contextPath(){return this._contextPath}set contextPath(t){let e=t??c();this._contextPath=e,this._response.contextPath=e,this._layoutHintProcessor.setContextPath(e)}get contributionsHref(){return this._contributionsHref}set contributionsHref(t){this._contributionsHref=t}set locale(t){this._locale=t,this._response.locale=t,this._layoutHintProcessor.setRequestOptions(this.options)}get locale(){return this._locale}get response(){return this._response}set href(t){this._href=t}get href(){return this._href}set method(t){this._method=t}get method(){return this._method}get options(){return{...this._options,locale:this.locale,method:this.method}}set options(t){this._options=t,this._layoutHintProcessor.setRequestOptions(t)}get requestOptions(){let{targetModel:t,forceTargetModel:e,updateHandler:i,childmodels:r,isValidationRequest:o,removeOnUnmount:d,...a}=this.options;return a}get withChildModels(){return!("childmodels"in this.options)||this.options.childmodels===!0}set targetModel(t){this._targetModel=t}get targetModel(){return this._targetModel}set forceTargetModel(t){this._forceTargetModel=t??!1}get forceTargetModel(){return this._forceTargetModel}resolveModel(){let t;if(this.targetModel&&(t=Array.isArray(this.targetModel)?[...this.targetModel]:[this.targetModel],this.forceTargetModel))return t[0];let e=D(this.response,t);if(e&&typeof e.isApplicableModel=="function")return e;if(t){let i=t.map(r=>r.type);throw new f(`Can not find a model for url: '${this.href.toString()}', resourcetype: '${this.response?.resourcetype}', available: [${i}]`)}throw new f(`no javascript model is applicable for received request of ${this.href.toString()}, with response: ${JSON.stringify(this.response)}`)}createModel(){let t=this.resolveModel();return new t(this.response)}processContributionsService(t){if(!(0,N.isPlainObject)(t))throw new h("Missing contributions data or contributions is not JSON");if(typeof t=="object"&&t!=null){let e=t,[i]=Object.keys(e),r=e[i];i==="error"&&this.handleContributionsError(r),typeof r=="object"&&r!=null&&(this.response.key in r||(this.response.key=i),this.response.contributions=r)}}handleContributionsError(t){let e=t.properties?.message??"Error in contribution";throw new u(e,t,this.contributionsHref)}handleDataError(t){if(typeof t=="object"&&t.properties){let e=t.properties?.message??"Error in data";throw new u(e,t,this.href.absolutepath.toString())}throw new h(JSON.stringify(t))}handleData(t,e){this.response.key=t,this.response.data=e;let i=e?._links;if(!i)throw new h(`No _links object found in the data of ${this.href.toString()}`);if(i?.contributions)this.contributionsHref=i.contributions.href;else if(Array.isArray(i)&&i[0].contributions)this.contributionsHref=i[0].contributions.href;else throw new h(`Contributions link not found for data with key ${t}`)}processDataService(t){if(typeof t!="object"||t===null)throw new h("Missing data or data is not JSON");let e=t,[i]=Object.keys(e),r=e[i];if(i==="error")this.handleDataError(r);else{let[o]=Object.keys(t);this.handleData(o,r)}}fetchContributionsService(){if(!this.contributionsHref)throw new f("Missing a contributions href");return s({url:`${this.origin}${this.contextPath}${this.contributionsHref}`,cache:!0,locale:this.options.locale})}fetchDataService(){return s({...this.requestOptions,url:`${this.origin}${this.contextPath}${this.href.path}`,params:this.href.getQuerystringForModularUI(),locale:this.options.locale,onProgress:this.onProgress})}set onProgress(t){this._progressEvent=t}get onProgress(){return this._progressEvent}getDynamicValidationData(t){let e=typeof this.options.data=="string"?JSON.parse(this.options.data):this.options.data;if(t instanceof m){let i=JSON.parse(t.validationData);return JSON.stringify(J(e||{},i))}return JSON.stringify(e)??"{}"}async loadDynamicValidations(t){if(!this.options.isValidationRequest&&y("USE_INSTANT_SERVER_VALIDATION")&&t instanceof m&&t.currentFormObject&&t.currentFormObject.hasDynamicValidations){let e=this.href.setParameter("commit","false"),i=await s({...this.requestOptions,url:`${this.origin}${this.contextPath}${this.href.path}`,params:e.getQuerystringForModularUI(),data:this.getDynamicValidationData(t)});if(i==null||typeof i!="object")return t;let r=i,[o]=Object.keys(r);return t.updateValidations(r[o])}return t}fetchFromCache(){return this.options={...this.options,cache:!0},this.fetch()}fetchChildModels(t){let i=t.getInitialChildModelLinks().map(r=>{let o=new n(r.href,{locale:this.locale});return r.targetModel&&(o.targetModel=r.targetModel),r.isCacheable?o.fetchFromCache():o.fetch()});return Promise.allSettled(i).then(r=>{let o=[],d=[];return r.forEach(a=>{if(a.status==="rejected"){let{reason:_}=a;_.name!=="Error.ChangePasswordRequired"&&console.debug("Unexpected error when retrieving child model:",_),d.push(new S(_,"",{origin:this.origin,contextPath:this.contextPath}))}else o.push(a.value)}),t instanceof v&&t.addChildModels(o,d),t})}fetchContent(t){return this.fetchFromCache().then(e=>t&&e instanceof k&&e.childSectionLinks.length>0?this.fetchContentChildSections(e):Promise.resolve(e))}fetchContentChildSections(t){let e=B(t);return Promise.all(t.childSectionLinks.map(i=>{let r=i.selfhref.addParameter(x,t.entryDate);return new n(r,{locale:this.locale}).fetchContent(!0)})).then(i=>(e.childSections=i.filter(r=>r instanceof O),e))}async fetch(){let t=await this.fetchDataService();if(t==null)throw new Error(`No data received for ${this.href.toString()}`);this.processDataService(t);let e=await this.fetchContributionsService();if(e==null)throw new Error(`No contributions data received for ${this.contributionsHref}`);this.processContributionsService(e),await this._layoutHintProcessor.processAsyncLayoutHints(this.response);let i=this.createModel(),r=await this.loadDynamicValidations(i);return this.withChildModels?await this.fetchChildModels(r):r}post(t){return this.method="POST",this.options={...this.options,data:t},this.fetch()}postForm(t){return this.method="POST",this.options={...this.options,data:t.formdata},this.fetch().then(e=>e instanceof m?t.update(e):Promise.resolve(t))}fetchSync(){let t={headers:{"Accept-Language":this.locale}},e=dataFetcher.fetch(this.href.toString(),t);if(e==null)throw new Error(`No data received for ${this.href.toString()}`);if(this.processDataService(JSON.parse(e)),this.contributionsHref==null)throw new Error(`No constributions received for ${this.href.toString()}`);let i=dataFetcher.fetch(this.contributionsHref.toString(),t);if(i==null)throw new Error(`No constributions received for ${this.contributionsHref.toString()}`);this.processContributionsService(JSON.parse(i));let r=this.createModel(),d=r.getInitialChildModelLinks().map(a=>new n(a.href,{locale:this.locale}).fetchSync());return r instanceof v&&r.addChildModels(d,[]),r}};export{L as a,U as b,u as c,$ as d};
2
- //# sourceMappingURL=chunk-BE2T4IDL.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/modularui/Authenticate.ts","../src/modularui/CaptchaRequest.ts","../src/modularui/ModularUIError.ts","../src/modularui/ModularUIRequest.ts"],"sourcesContent":["import { HTTP_METHODS, INTERNAL_LOGIN_TYPE } from \"../constants/Constants\";\nimport { UnauthorizedException } from \"../exceptions/UnauthorizedException\";\nimport { getContextPath } from \"../settings/Paths\";\nimport {\n loginPasswordField,\n loginPath,\n loginType,\n loginUsernameField,\n logoutPath,\n} from \"../settings/Settings\";\nimport { universalFetch } from \"../utils/fetch/universalFetch\";\nimport { Cache } from \"../utils/storage/Cache\";\n\nexport class Authenticate {\n private _isBasicAuthentication: boolean;\n private _authenticationType: INTERNAL_LOGIN_TYPE;\n\n constructor() {\n this._isBasicAuthentication = false;\n this._authenticationType = this.getAuthenticationType();\n }\n\n getAuthenticationType() {\n const type = loginType();\n\n const enumType =\n INTERNAL_LOGIN_TYPE[type as keyof typeof INTERNAL_LOGIN_TYPE];\n\n if (!enumType || enumType === INTERNAL_LOGIN_TYPE.JAAS) {\n return INTERNAL_LOGIN_TYPE.JAAS;\n }\n\n if (\n enumType === INTERNAL_LOGIN_TYPE.PAC4J_FORM ||\n type.includes(\"FormClient\")\n ) {\n return INTERNAL_LOGIN_TYPE.PAC4J_FORM;\n } else if (\n enumType === INTERNAL_LOGIN_TYPE.PAC4J_BASIC ||\n type.includes(\"BasicClient\")\n ) {\n return INTERNAL_LOGIN_TYPE.PAC4J_BASIC;\n }\n\n throw new Error(`Unsupported login type found: ${type}`);\n }\n\n get authenticationType() {\n return this._authenticationType;\n }\n\n set authenticationType(authenticationType: INTERNAL_LOGIN_TYPE) {\n this._authenticationType = authenticationType;\n }\n\n get isBasicAuthentication() {\n return (\n this._isBasicAuthentication ||\n this.authenticationType === INTERNAL_LOGIN_TYPE.PAC4J_BASIC\n );\n }\n\n set isBasicAuthentication(isBasicAuthentication: boolean) {\n this._isBasicAuthentication = isBasicAuthentication;\n }\n\n requestLogin() {\n return universalFetch({\n url: `${getContextPath()}/login`,\n method: HTTP_METHODS.GET,\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/x-www-form-urlencoded\",\n },\n });\n }\n\n initLogin(initLogin: boolean) {\n if (this.isBasicAuthentication || !initLogin) {\n return Promise.resolve(true);\n }\n\n return this.requestLogin().catch((error) => {\n // when an unauthorizedexception is received on a request to the login service,\n // this indicates a basic authorization scenario\n // in case of form based authentication other exceptions are thrown\n if (error instanceof UnauthorizedException) {\n this.isBasicAuthentication = true;\n }\n\n return Promise.resolve({});\n });\n }\n\n login(username: string, password: string) {\n switch (this.authenticationType) {\n case INTERNAL_LOGIN_TYPE.PAC4J_FORM:\n return this.doFormLogin(username, password);\n case INTERNAL_LOGIN_TYPE.PAC4J_BASIC:\n return this.doBasicAuthentication(username, password);\n default:\n return this.doJaasAuthentication(username, password);\n }\n }\n\n getFormLoginUrl() {\n switch (this.authenticationType) {\n case INTERNAL_LOGIN_TYPE.PAC4J_BASIC:\n return `${getContextPath()}${loginPath(\"DirectBasicAuthClient\")}`;\n case INTERNAL_LOGIN_TYPE.PAC4J_FORM:\n return `${getContextPath()}${loginPath(\"FormClient\")}`;\n default:\n return `${getContextPath()}/j_security_check`;\n }\n }\n\n getFormLoginData(username: string, password: string) {\n const encodedUsername = encodeURIComponent(username);\n const encodedPassword = encodeURIComponent(password);\n\n switch (this.authenticationType) {\n case INTERNAL_LOGIN_TYPE.PAC4J_BASIC:\n case INTERNAL_LOGIN_TYPE.PAC4J_FORM:\n return `${loginUsernameField()}=${encodedUsername}&${loginPasswordField()}=${encodedPassword}`;\n default:\n return `j_username=${encodedUsername}&j_password=${encodedPassword}`;\n }\n }\n\n doFormLogin(username: string, password: string) {\n return universalFetch({\n url: this.getFormLoginUrl(),\n method: HTTP_METHODS.POST,\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/x-www-form-urlencoded\",\n },\n data: this.getFormLoginData(username, password),\n });\n }\n\n doBasicAuthentication(username: string, password: string) {\n Cache.addItem(\"basic\", btoa(`${username}:${password}`));\n return this.requestLogin();\n }\n\n doJaasAuthentication(username: string, password: string) {\n return this.initLogin(true).then(() => {\n if (this.isBasicAuthentication) {\n Cache.removeItem(\"basic-ok\");\n return this.doBasicAuthentication(username, password).then(() => {\n Cache.addItem(\"basic-ok\", true);\n });\n }\n return this.doFormLogin(username, password);\n });\n }\n\n getLogoutUrl() {\n switch (this.authenticationType) {\n case INTERNAL_LOGIN_TYPE.PAC4J_BASIC:\n case INTERNAL_LOGIN_TYPE.PAC4J_FORM:\n return `${getContextPath()}${logoutPath()}`;\n default:\n return `${getContextPath()}/Logoff`;\n }\n }\n\n logout() {\n return universalFetch({\n url: this.getLogoutUrl(),\n }).then((response) => {\n // clear cache because of cached contributions\n Cache.clear();\n return response;\n });\n }\n}\n","import { HTTP_METHODS } from \"../constants/Constants\";\nimport { getCaptchaPath, getContextPathModularUI } from \"../settings/Paths\";\nimport { xhr } from \"../utils/fetch/xhr\";\n\ninterface CaptchaInitialResponse {\n tokenId: string;\n image: string;\n}\n\ninterface CaptchaValidResponse {\n valid: boolean;\n}\n\ninterface CaptchaInvalidResponse {\n tokenId: string;\n image: string;\n valid: boolean;\n error: { id: string };\n}\n\ntype PossibleCaptchaResponse =\n | CaptchaInitialResponse\n | CaptchaValidResponse\n | CaptchaInvalidResponse;\n\ninterface CaptchaRequestOptions {\n origin?: string;\n contextPath?: string;\n}\n\nexport class CaptchaRequest {\n private _tokenId: string | undefined;\n private _image: string | undefined;\n private _origin = \"\";\n private _contextPath: string = getContextPathModularUI();\n\n CaptchaRequest(options?: CaptchaRequestOptions) {\n this._origin = options?.origin || \"\";\n this._contextPath = options?.contextPath || getContextPathModularUI();\n }\n\n captchaResponse(response: PossibleCaptchaResponse) {\n this._tokenId = \"tokenId\" in response ? response.tokenId : this._tokenId;\n this._image = \"image\" in response ? response.image : this._image;\n\n return {\n tokenId: this._tokenId,\n image: this._image,\n valid: \"valid\" in response ? response.valid : false,\n error: \"error\" in response ? response.error : null,\n };\n }\n\n /**\n * Initiate the captcha request\n */\n init() {\n return xhr<CaptchaInitialResponse>({\n url: getCaptchaPath(this._contextPath, this._origin),\n }).then((response) => this.captchaResponse(response));\n }\n\n /**\n * Answer the captcha\n */\n send(answer?: string) {\n return xhr<CaptchaValidResponse | CaptchaInvalidResponse>({\n url: getCaptchaPath(this._contextPath, this._origin),\n method: HTTP_METHODS.POST,\n data: {\n tokenId: this._tokenId ?? \"\",\n answer: answer ?? \"\",\n },\n })\n .then((response) => this.captchaResponse(response))\n .catch((error) => this.captchaResponse(error.response));\n }\n\n /**\n * Reset the captcha and receive a new token and image\n */\n refresh() {\n return this.init();\n }\n}\n\nexport default CaptchaRequest;\n","import type { Href } from \"../models/href/Href\";\n\nexport class ModularUIError extends Error {\n response: object;\n href: Href | string | undefined;\n\n constructor(message: string, response: object, href?: string | Href) {\n super(message);\n\n this.response = response;\n this.href = href;\n\n // Without passing ModularUIError to captureStackTrace, the ModularUIError\n // frame would show up in the .stack property. By passing\n // the constructor, we omit that frame, and retain all frames below it.\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, ModularUIError);\n }\n }\n\n get resource() {\n return this.href;\n }\n}\n","import deepmerge from \"deepmerge\";\nimport { klona } from \"klona/full\";\nimport { isPlainObject } from \"lodash\";\n\nimport { HTTP_METHODS, TIMEVERSION_FILTER_NAME } from \"../constants/Constants\";\nimport { IllegalArgumentException } from \"../exceptions/IllegalArgumentException\";\nimport { IllegalStateException } from \"../exceptions/IllegalStateException\";\nimport { LayoutHintProcessor } from \"../layouthints/LayoutHintProcessor\";\nimport { ResourceModel } from \"../models/base/ResourceModel\";\nimport { ContentModel } from \"../models/content/ContentModel\";\nimport { SectionModel } from \"../models/content/SectionModel\";\nimport { ErrorResponse } from \"../models/error/ErrorResponse\";\nimport { FormModel } from \"../models/form/FormModel\";\nimport { Href } from \"../models/href/Href\";\nimport { resolveModel } from \"../models/resolveModel\";\nimport { getContextPathModularUI } from \"../settings/Paths\";\nimport { getBooleanSetting } from \"../settings/Settings\";\nimport { universalFetch } from \"../utils/fetch/universalFetch\";\nimport { ModularUIError } from \"./ModularUIError\";\nimport { ModularUIResponse } from \"./ModularUIResponse\";\n\nimport type { FormData } from \"../models/form/types\";\nimport type {\n ModularUIModel,\n ModularUIModelWithChildModels,\n} from \"../models/types\";\nimport type { Contributions, Data, DefaultLinksData } from \"../types/types\";\nimport type {\n ModularUIRequestOptions,\n ProgressHandler,\n} from \"../utils/fetch/types\";\nimport type { ModularUISpecificErrorResponse, TargetModel } from \"./types\";\n\n/**\n * Helper for fetching data and contributions from the Be Informed modular ui\n * and merge it into a target or resolvable model.\n *\n * @example\n * const model = new ModularUIRequest(\"url-to-request\").fetch();\n * const post = new ModularUIRequest(\"url-to-request\", { method: \"POST\"}).fetch();\n */\nexport class ModularUIRequest {\n private _response: ModularUIResponse = new ModularUIResponse();\n\n private _href: Href;\n private _options: ModularUIRequestOptions;\n private _targetModel: TargetModel | undefined;\n private _forceTargetModel = false;\n private _contributionsHref: Href | string | undefined;\n private _locale = \"en\";\n private _method: HTTP_METHODS = HTTP_METHODS.GET;\n\n private _progressEvent: ProgressHandler | undefined;\n\n private _origin = \"\";\n private _contextPath: string = getContextPathModularUI();\n\n private _layoutHintProcessor: LayoutHintProcessor;\n\n constructor(href: Href | string, options: ModularUIRequestOptions = {}) {\n if (!href) {\n throw new IllegalArgumentException(\n \"You must pass a href to the resource that is requested\",\n );\n }\n\n this._href = typeof href === \"string\" ? new Href(href) : href;\n this._options = options;\n\n this._layoutHintProcessor = new LayoutHintProcessor(\n this._origin,\n this._contextPath,\n this.options,\n );\n\n this._response = new ModularUIResponse();\n this._response.requestHref = this.href;\n\n this.locale = this.getRequestLocale(options.locale);\n\n // copy request parameters to response, to be able to use them in the models\n // self links are missing the request parameters\n this._response.parameters = this.href.parameters.all;\n\n this.contextPath = options.contextPath || this.href.contextPath;\n this.origin = options.origin || this.href.origin;\n\n this._targetModel = options.targetModel;\n this.method = options.method || this.href.method;\n }\n\n /**\n * Retrieve the preferred language for this request, falls back to the browser language or english\n */\n getRequestLocale(optionLocale: string | undefined) {\n if (optionLocale) {\n return optionLocale;\n }\n\n if (typeof navigator !== \"undefined\" && navigator?.language) {\n return navigator.language.split(\"-\")[0] || \"en\";\n }\n\n return \"en\";\n }\n\n get origin() {\n return this._origin;\n }\n\n set origin(origin: string | undefined) {\n this._origin = origin ?? \"\";\n this._response.origin = origin ?? \"\";\n this._layoutHintProcessor.setOrigin(this._origin);\n }\n\n get contextPath() {\n return this._contextPath;\n }\n\n set contextPath(contextPath: string | undefined) {\n const path = contextPath ?? getContextPathModularUI();\n this._contextPath = path;\n this._response.contextPath = path;\n this._layoutHintProcessor.setContextPath(path);\n }\n\n get contributionsHref() {\n return this._contributionsHref;\n }\n\n set contributionsHref(contributionsHref: string | Href | undefined) {\n this._contributionsHref = contributionsHref;\n }\n\n set locale(locale: string) {\n this._locale = locale;\n this._response.locale = locale;\n this._layoutHintProcessor.setRequestOptions(this.options);\n }\n\n get locale() {\n return this._locale;\n }\n\n get response() {\n return this._response;\n }\n\n set href(href: Href) {\n this._href = href;\n }\n\n get href() {\n return this._href;\n }\n\n set method(method: HTTP_METHODS) {\n this._method = method;\n }\n\n get method() {\n return this._method;\n }\n\n get options() {\n return {\n ...this._options,\n locale: this.locale,\n method: this.method,\n };\n }\n\n set options(options: ModularUIRequestOptions) {\n this._options = options;\n this._layoutHintProcessor.setRequestOptions(options);\n }\n\n get requestOptions() {\n const {\n targetModel,\n forceTargetModel,\n updateHandler,\n childmodels,\n isValidationRequest,\n removeOnUnmount,\n ...requestOptions\n } = this.options;\n\n return requestOptions;\n }\n\n get withChildModels() {\n return (\n !(\"childmodels\" in this.options) || this.options.childmodels === true\n );\n }\n\n set targetModel(targetModel: TargetModel | undefined) {\n this._targetModel = targetModel;\n }\n\n get targetModel() {\n return this._targetModel;\n }\n\n set forceTargetModel(forceTargetModel: boolean) {\n this._forceTargetModel = forceTargetModel ?? false;\n }\n\n get forceTargetModel() {\n return this._forceTargetModel;\n }\n\n private resolveModel() {\n let availableModels;\n if (this.targetModel) {\n availableModels = Array.isArray(this.targetModel)\n ? [...this.targetModel]\n : [this.targetModel];\n\n if (this.forceTargetModel) {\n return availableModels[0];\n }\n }\n\n const Model = resolveModel(this.response, availableModels);\n\n if (Model && typeof Model.isApplicableModel === \"function\") {\n return Model;\n }\n\n if (availableModels) {\n const availableModelTypes = availableModels.map((model) => model.type);\n throw new IllegalStateException(\n `Can not find a model for url: '${this.href.toString()}', resourcetype: '${this.response?.resourcetype}', available: [${availableModelTypes}]`,\n );\n }\n\n throw new IllegalStateException(\n `no javascript model is applicable for received request of ${this.href.toString()}, with response: ${JSON.stringify(\n this.response,\n )}`,\n );\n }\n\n private createModel() {\n const Model = this.resolveModel();\n return new Model(this.response);\n }\n\n private processContributionsService(contributions: unknown) {\n if (!isPlainObject(contributions)) {\n throw new IllegalArgumentException(\n \"Missing contributions data or contributions is not JSON\",\n );\n }\n\n if (typeof contributions === \"object\" && contributions != null) {\n const record = contributions as Record<string, Contributions>;\n const [key] = Object.keys(record);\n const contributionsBody = record[key];\n if (key === \"error\") {\n this.handleContributionsError(contributionsBody);\n }\n if (typeof contributionsBody === \"object\" && contributionsBody != null) {\n // The key of the data service is different from the contributions service for forms\n if (!(this.response.key in contributionsBody)) {\n this.response.key = key;\n }\n\n this.response.contributions = contributionsBody;\n }\n }\n }\n\n private handleContributionsError(error: ModularUISpecificErrorResponse) {\n const errorMessage = error.properties?.message ?? \"Error in contribution\";\n throw new ModularUIError(errorMessage, error, this.contributionsHref);\n }\n\n private handleDataError(error: ModularUISpecificErrorResponse | string) {\n if (typeof error === \"object\" && error.properties) {\n const errorMessage = error.properties?.message ?? \"Error in data\";\n throw new ModularUIError(\n errorMessage,\n error,\n this.href.absolutepath.toString(),\n );\n }\n\n throw new IllegalArgumentException(JSON.stringify(error));\n }\n\n private handleData(key: string, data: Data | undefined) {\n this.response.key = key;\n this.response.data = data;\n\n const links = data?._links as DefaultLinksData | undefined;\n\n if (!links) {\n throw new IllegalArgumentException(\n `No _links object found in the data of ${this.href.toString()}`,\n );\n }\n\n if (links?.contributions) {\n this.contributionsHref = links.contributions.href;\n } else if (Array.isArray(links) && links[0].contributions) {\n this.contributionsHref = links[0].contributions.href;\n } else {\n throw new IllegalArgumentException(\n `Contributions link not found for data with key ${key}`,\n );\n }\n }\n\n private processDataService(data: unknown) {\n if (typeof data !== \"object\" || data === null) {\n throw new IllegalArgumentException(\"Missing data or data is not JSON\");\n }\n\n const record = data as Record<string, Data>;\n const [key] = Object.keys(record);\n const dataBody = record[key];\n\n if (key === \"error\") {\n this.handleDataError(dataBody);\n } else {\n const [key] = Object.keys(data);\n this.handleData(key, dataBody);\n }\n }\n\n private fetchContributionsService() {\n if (!this.contributionsHref) {\n throw new IllegalStateException(\"Missing a contributions href\");\n }\n\n return universalFetch({\n url: `${this.origin}${this.contextPath}${this.contributionsHref}`,\n cache: true,\n locale: this.options.locale,\n });\n }\n\n private fetchDataService() {\n return universalFetch({\n ...this.requestOptions,\n url: `${this.origin}${this.contextPath}${this.href.path}`,\n params: this.href.getQuerystringForModularUI(),\n locale: this.options.locale,\n onProgress: this.onProgress,\n });\n }\n\n set onProgress(progressEvent: ProgressHandler | undefined) {\n this._progressEvent = progressEvent;\n }\n\n get onProgress() {\n return this._progressEvent;\n }\n\n /**\n * Combine previous send request data with new validation data to create a complete request object\n * The received model is new FormModel containing ONLY the current question, not the previously entered questions\n * to create a complete request we append the originally send form objects\n */\n private getDynamicValidationData(model: ModularUIModel) {\n const prevData =\n typeof this.options.data === \"string\"\n ? JSON.parse(this.options.data)\n : this.options.data;\n\n if (model instanceof FormModel) {\n const newData = JSON.parse(model.validationData);\n return JSON.stringify(deepmerge(prevData || {}, newData));\n }\n\n return JSON.stringify(prevData) ?? \"{}\";\n }\n\n /**\n * First load of dynamic values when a form is loaded\n */\n private async loadDynamicValidations(model: ModularUIModel) {\n if (\n !this.options.isValidationRequest &&\n getBooleanSetting(\"USE_INSTANT_SERVER_VALIDATION\") &&\n model instanceof FormModel &&\n model.currentFormObject &&\n model.currentFormObject.hasDynamicValidations\n ) {\n const validationHref = this.href.setParameter(\"commit\", \"false\");\n const data = await universalFetch({\n ...this.requestOptions,\n url: `${this.origin}${this.contextPath}${this.href.path}`,\n params: validationHref.getQuerystringForModularUI(),\n data: this.getDynamicValidationData(model),\n });\n\n if (data == null || typeof data !== \"object\") {\n return model;\n }\n\n const formResponse = data as Record<string, FormData>;\n const [key] = Object.keys(formResponse);\n return model.updateValidations(formResponse[key]);\n }\n\n return model;\n }\n\n private fetchFromCache() {\n this.options = {\n ...this.options,\n cache: true,\n };\n\n return this.fetch();\n }\n\n private fetchChildModels(model: ModularUIModel) {\n const childModelLinks = (\n model as ModularUIModelWithChildModels\n ).getInitialChildModelLinks();\n\n const childModelRequests: Promise<ModularUIModel>[] = childModelLinks.map(\n (childModelLink) => {\n const request = new ModularUIRequest(childModelLink.href, {\n locale: this.locale,\n });\n\n if (childModelLink.targetModel) {\n request.targetModel = childModelLink.targetModel;\n }\n\n if (childModelLink.isCacheable) {\n return request.fetchFromCache();\n }\n\n return request.fetch();\n },\n );\n\n return Promise.allSettled(childModelRequests).then((childModels) => {\n const resolvedChildModels: ModularUIModelWithChildModels[] = [];\n const errorChildModels: ErrorResponse[] = [];\n\n childModels.forEach((childModel) => {\n if (childModel.status === \"rejected\") {\n const { reason } = childModel;\n if (reason.name !== \"Error.ChangePasswordRequired\") {\n console.debug(\n \"Unexpected error when retrieving child model:\",\n reason,\n );\n }\n errorChildModels.push(\n new ErrorResponse(reason, \"\", {\n origin: this.origin,\n contextPath: this.contextPath,\n }),\n );\n } else {\n resolvedChildModels.push(\n childModel.value as ModularUIModelWithChildModels,\n );\n }\n });\n\n if (model instanceof ResourceModel) {\n model.addChildModels(resolvedChildModels, errorChildModels);\n }\n\n return model;\n });\n }\n\n fetchContent(withChildSections: boolean) {\n return this.fetchFromCache().then((model) => {\n if (\n withChildSections &&\n model instanceof ContentModel &&\n model.childSectionLinks.length > 0\n ) {\n return this.fetchContentChildSections(model);\n }\n\n return Promise.resolve(model);\n });\n }\n\n /**\n * Recursively return child sections defined on the content model\n */\n fetchContentChildSections(contentModel: ContentModel): Promise<ContentModel> {\n const newContentModel = klona(contentModel);\n\n return Promise.all(\n contentModel.childSectionLinks.map((childSectionLink) => {\n const contentHrefWithEntryDate = childSectionLink.selfhref.addParameter(\n TIMEVERSION_FILTER_NAME,\n contentModel.entryDate,\n );\n\n const request = new ModularUIRequest(contentHrefWithEntryDate, {\n locale: this.locale,\n });\n\n return request.fetchContent(true);\n }),\n ).then((sectionModels) => {\n newContentModel.childSections = sectionModels.filter(\n (sectionModel) => sectionModel instanceof SectionModel,\n );\n\n return newContentModel;\n });\n }\n\n async fetch() {\n const data = await this.fetchDataService();\n if (data == null) {\n throw new Error(`No data received for ${this.href.toString()}`);\n }\n\n this.processDataService(data);\n\n const contributions = await this.fetchContributionsService();\n if (contributions == null) {\n throw new Error(\n `No contributions data received for ${this.contributionsHref}`,\n );\n }\n\n this.processContributionsService(contributions);\n\n await this._layoutHintProcessor.processAsyncLayoutHints(this.response);\n\n const model = this.createModel();\n\n const validatedModel = await this.loadDynamicValidations(model);\n if (this.withChildModels) {\n return await this.fetchChildModels(validatedModel);\n }\n return validatedModel;\n }\n\n /**\n * Make a post request with optionally data to send\n * @param data\n */\n post(data: string) {\n this.method = HTTP_METHODS.POST;\n this.options = {\n ...this.options,\n data,\n };\n\n return this.fetch();\n }\n\n /**\n * Make a POST request using the form, an updated form is returned (merge of old and new form)\n * @param form\n * @returns {Promise<FormModel>}\n */\n postForm(form: FormModel) {\n this.method = HTTP_METHODS.POST;\n this.options = {\n ...this.options,\n data: form.formdata,\n };\n\n return this.fetch().then((response) => {\n if (response instanceof FormModel) {\n return form.update(response);\n }\n return Promise.resolve(form);\n });\n }\n\n /**\n * Simplified synchronous version of fetch (returns the model, not a Promise)\n * This can be used on the server to retrieve a model. It only loads the request url and it's child models\n */\n fetchSync() {\n const options = { headers: { \"Accept-Language\": this.locale } };\n\n const dataString = dataFetcher.fetch(this.href.toString(), options);\n if (dataString == null) {\n throw new Error(`No data received for ${this.href.toString()}`);\n }\n\n this.processDataService(JSON.parse(dataString));\n\n if (this.contributionsHref == null) {\n throw new Error(`No constributions received for ${this.href.toString()}`);\n }\n\n const contributionsString = dataFetcher.fetch(\n this.contributionsHref.toString(),\n options,\n );\n if (contributionsString == null) {\n throw new Error(\n `No constributions received for ${this.contributionsHref.toString()}`,\n );\n }\n this.processContributionsService(JSON.parse(contributionsString));\n\n const model: ResourceModel = this.createModel();\n\n const childModelLinks = model.getInitialChildModelLinks();\n\n const childModels = childModelLinks.map((childModelLink) => {\n return new ModularUIRequest(childModelLink.href, {\n locale: this.locale,\n }).fetchSync();\n });\n if (model instanceof ResourceModel) {\n model.addChildModels(childModels, []);\n }\n\n return model;\n }\n}\n"],"mappings":"khBAaO,IAAMA,EAAN,KAAmB,CAChB,uBACA,oBAER,aAAc,CACZ,KAAK,uBAAyB,GAC9B,KAAK,oBAAsB,KAAK,sBAAsB,CACxD,CAEA,uBAAwB,CACtB,IAAMC,EAAOC,EAAU,EAEjBC,EACJC,EAAoBH,CAAw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AC,EAAE,UAAU,CACd,EACD,OAAItB,aAAiB8B,GACnB9B,EAAM,eAAewB,EAAa,CAAC,CAAC,EAG/BxB,CACT,CACF","names":["Authenticate","type","loginType","enumType","INTERNAL_LOGIN_TYPE","authenticationType","isBasicAuthentication","universalFetch","getContextPath","initLogin","error","UnauthorizedException","username","password","loginPath","encodedUsername","encodedPassword","loginUsernameField","loginPasswordField","cacheInstance","logoutPath","response","CaptchaRequest","getContextPathModularUI","options","response","xhr","getCaptchaPath","answer","error","ModularUIError","_ModularUIError","message","response","href","import_lodash","deepmerge","klona","ModularUIRequest","_ModularUIRequest","ModularUIResponse","getContextPathModularUI","href","options","IllegalArgumentException","Href","LayoutHintProcessor","optionLocale","origin","contextPath","path","contributionsHref","locale","method","targetModel","forceTargetModel","updateHandler","childmodels","isValidationRequest","removeOnUnmount","requestOptions","availableModels","Model","resolveModel","availableModelTypes","model","IllegalStateException","contributions","record","key","contributionsBody","error","errorMessage","ModularUIError","data","links","dataBody","universalFetch","progressEvent","prevData","FormModel","newData","deepmerge","getBooleanSetting","validationHref","formResponse","childModelRequests","childModelLink","request","childModels","resolvedChildModels","errorChildModels","childModel","reason","ErrorResponse","ResourceModel","withChildSections","ContentModel","contentModel","newContentModel","klona","childSectionLink","contentHrefWithEntryDate","TIMEVERSION_FILTER_NAME","sectionModels","sectionModel","SectionModel","validatedModel","form","response","dataString","contributionsString"]}
@@ -1,2 +0,0 @@
1
- import{a as w}from"./chunk-VGAPPKHA.js";import{e as k,g as y,m as H,n as R,w as U,x as F,y as $}from"./chunk-LYBG43T6.js";import{c as O,f as m,h as A,i as P,j as v,k as M,l as D,m as C,n as E}from"./chunk-77CGPEAQ.js";import{immerable as G}from"immer";var f=class n{[G]=!0;_collection;constructor(t=[]){this._collection=t}get collection(){return this._collection}set collection(t){this._collection=t}get all(){return this.collection}add(t){t instanceof n?this.collection=[...this.collection,...t.all]:Array.isArray(t)?this.collection=[...this.collection,...t]:this.collection=[...this.collection,t]}removeByIndex(t){t>-1&&(this.collection=[...this.collection.slice(0,t),...this.collection.slice(t+1)])}hasItems(){return this.length>0}isEmpty(){return!this.hasItems()}get length(){return this.collection.length}get size(){return this.length}get first(){return this.collection[0]}get last(){return this.collection[this.collection.length-1]}get(t){return this.collection[t]}find(t,e){return this.collection.find(t,e)}filter(t,e){return this.collection.filter(t,e)}some(t,e){return this.collection.some(t,e)}every(t,e){return this.collection.every(t,e)}map(t,e){return this.collection.map(t,e)}forEach(t,e){this.collection.forEach(t,e)}sort(t){return this.collection.sort(t)}get sorted(){return this.collection.sort()}clear(){this.collection=[]}};import x from"js-cookie";var N=n=>x.get(n),lt=(n,t,e)=>{let r={path:F(),expires:e?.days,sameSite:e?.sameSite??"Strict",secure:e?.secure};x.set(n,t,r)},mt=n=>{x.remove(n,{path:F()})};import{tz as Q}from"@date-fns/tz/tz";import{add as u}from"date-fns/add";import{endOfMonth as z}from"date-fns/endOfMonth";import{format as S}from"date-fns/format";import{getDay as B}from"date-fns/getDay";import{getHours as q}from"date-fns/getHours";import{getMinutes as Y}from"date-fns/getMinutes";import{getWeek as K}from"date-fns/getWeek";import{isAfter as L}from"date-fns/isAfter";import{isBefore as V}from"date-fns/isBefore";import{isSameDay as J}from"date-fns/isSameDay";import{isValid as p}from"date-fns/isValid";import{enGB as X,nl as tt}from"date-fns/locale";import{parse as et}from"date-fns/parse";import{set as W}from"date-fns/set";import{startOfMonth as rt}from"date-fns/startOfMonth";import{startOfWeek as st}from"date-fns/startOfWeek";import{sub as h}from"date-fns/sub";import it from"timezone-soft";var c=class{_isoFormat;_doOffsets;_timeZone=typeof Intl>"u"?"Etc/UTC":Intl.DateTimeFormat().resolvedOptions().timeZone||"Etc/UTC";constructor(t,e=!1){this._isoFormat=t,this._doOffsets=e}get doOffsets(){return this._doOffsets?H():!1}getOptions(){let t=y("CALENDAR_WEEK_STARTS_ON",C),e=y("CALENDAR_FIRST_WEEK_CONTAINS_DATE",E);return{weekStartsOn:t>-1&&t<7?t:void 0,firstWeekContainsDate:e===1||e===4?e:void 0}}getIsoFormat(){return this.doOffsets?this._isoFormat+D:this._isoFormat}convertFormat(t){if(!t)return this.getIsoFormat();let e={ZZZ:"xxx",ZZ:"xx",Z:"x"},r=t,s=Object.keys(e).sort((i,a)=>a.length-i.length);for(let i of s){let a=e[i],o=new RegExp(i,"g");r=r.replace(o,a)}return r}getLocale(){let t=R()[0];return(N("locale")??t??"en")==="nl"?tt:X}toDate(t,e=this.getIsoFormat()){if(t instanceof Date)return t;let{weekStartsOn:r,firstWeekContainsDate:s}=this.getOptions();return et(t,e,new Date,{in:this.getDateFnsContext(),weekStartsOn:r,firstWeekContainsDate:s})}toFormat(t,e,r=this.getIsoFormat()){let{weekStartsOn:s}=this.getOptions(),i=this.toDate(t,r);return p(i)?S(i,e,{in:this.getDateFnsContext(),weekStartsOn:s,locale:this.getLocale()}):"Invalid Date"}toISO(t,e=this.getIsoFormat()){return this.toFormat(t,this.getIsoFormat(),e)}now(){return this.toISO(new Date)}hasFormat(t,e){let r=this.toDate(t,e),s=this.toFormat(r,e);return s==="Invalid Date"||V(r,new Date(1e3,1,1))||L(r,new Date(9999,11,31))?!1:s.replace(/0/gu,"").toUpperCase()===t.replace(/0/gu,"").toUpperCase()}isValid(t,e=this.getIsoFormat()){if(!t)return!1;let r=this.toDate(t,e);return p(r)}isAfter(t,e,r=this.getIsoFormat()){return e?L(this.toDate(t,r),this.toDate(e)):!1}isSameOrAfter(t,e,r=this.getIsoFormat()){return e?this.isAfter(t,e,r)||this.isSame(t,e,r):!1}isBefore(t,e,r=this.getIsoFormat()){return e?V(this.toDate(t,r),this.toDate(e)):!1}isSameOrBefore(t,e,r=this.getIsoFormat()){return e?this.isBefore(t,e,r)||this.isSame(t,e,r):!1}isSame(t,e,r=this.getIsoFormat()){return e?this.toDate(t,r).getTime()===this.toDate(e).getTime():!1}isSameDay(t,e,r=this.getIsoFormat()){return e?J(this.toDate(t,r),this.toDate(e,r)):!1}isOther(t,e,r=this.getIsoFormat()){return!this.isSame(t,e,r)}isWeekend(t){let s=B(this.toDate(t));return s===6||s===0}isAmbiguous(t,e=this.getIsoFormat()){if(t==null||typeof Intl>"u")return!1;let r=this.toDate(t,e);if(!p(r))return!1;let i=[60,-60,30,-30].map(o=>{let b=u(r,{minutes:o});return S(b,"HH:mm")}),a=S(r,"HH:mm");return i.indexOf(a)>-1}calculate(t,e,r,s,i=this.getIsoFormat()){let a=this.toDate(t,i);return this.toISO(e(a,{[r]:s},{in:this.getDateFnsContext()}))}addSeconds(t,e,r=this.getIsoFormat()){return this.calculate(t,u,"seconds",e,r)}addMinutes(t,e,r=this.getIsoFormat()){return this.calculate(t,u,"minutes",e,r)}addHours(t,e,r=this.getIsoFormat()){return this.calculate(t,u,"hours",e,r)}addDays(t,e,r=this.getIsoFormat()){return this.calculate(t,u,"days",e,r)}addWeeks(t,e,r=this.getIsoFormat()){return this.calculate(t,u,"weeks",e,r)}addMonths(t,e,r=this.getIsoFormat()){return this.calculate(t,u,"months",e,r)}addYears(t,e,r=this.getIsoFormat()){return this.calculate(t,u,"years",e,r)}subtractSeconds(t,e,r=this.getIsoFormat()){return this.calculate(t,h,"seconds",e,r)}subtractMinutes(t,e,r=this.getIsoFormat()){return this.calculate(t,h,"minutes",e,r)}subtractHours(t,e,r=this.getIsoFormat()){return this.calculate(t,h,"hours",e,r)}subtractDays(t,e,r=this.getIsoFormat()){return this.calculate(t,h,"days",e,r)}subtractWeeks(t,e,r=this.getIsoFormat()){return this.calculate(t,h,"weeks",e,r)}subtractMonths(t,e,r=this.getIsoFormat()){return this.calculate(t,h,"months",e,r)}subtractYears(t,e,r=this.getIsoFormat()){return this.calculate(t,h,"years",e,r)}get(t,e,r=this.getIsoFormat(),s={}){let i=this.toDate(t,r);return this.toISO(e(i,{in:this.getDateFnsContext(),...s}))}startOfMonth(t,e=this.getIsoFormat()){return this.get(t,rt,e)}endOfMonth(t,e=this.getIsoFormat()){return this.get(t,z,e)}startOfWeek(t,e=this.getIsoFormat()){let{weekStartsOn:r}=this.getOptions();return this.get(t,st,e,{weekStartsOn:r})}getHours(t,e=this.getIsoFormat()){let r=this.toDate(t,e);return q(r,{in:this.getDateFnsContext()})}getMinutes(t,e=this.getIsoFormat()){let r=this.toDate(t,e);return Y(r,{in:this.getDateFnsContext()})}getWeek(t,e=this.getIsoFormat()){let{weekStartsOn:r,firstWeekContainsDate:s}=this.getOptions(),i=this.toDate(t,e);return K(i,{in:this.getDateFnsContext(),weekStartsOn:r,firstWeekContainsDate:s})}set(t,e,r,s=this.getIsoFormat()){let i=this.toDate(t,s);return this.toISO(W(i,{[e]:r}))}setYear(t,e,r=this.getIsoFormat()){return this.set(t,"year",e,r)}setMonth(t,e,r=this.getIsoFormat()){return this.set(t,"month",e,r)}setDay(t,e,r=this.getIsoFormat()){return this.set(t,"date",e,r)}setHour(t,e,r=this.getIsoFormat()){return this.set(t,"hours",e,r)}setMinute(t,e,r=this.getIsoFormat()){return this.set(t,"minutes",e,r)}setSecond(t,e,r=this.getIsoFormat()){return this.set(t,"seconds",e,r)}setMilliseconds(t,e,r=this.getIsoFormat()){return this.set(t,"milliseconds",e,r)}setTime(t,e,r,s,i,a=this.getIsoFormat()){let o=this.toDate(t,a);return this.toISO(W(o,{hours:e,minutes:r,seconds:s,milliseconds:i},{in:this.getDateFnsContext()}))}getTimeZone(){return this._timeZone}setTimeZone(t){this._timeZone=t}getDateFnsContext(){if(this.doOffsets&&!O)return Q(this.getTimeZone())}getOffset(t,e=this.getIsoFormat()){let r=this.toDate(t,e);if(p(r)){let s=this.toFormat(r,D),i=this.getTimezoneOffsets();if(typeof i.daylight<"u"&&i.daylight.value===s)return i.daylight;if(typeof i.standard<"u"&&i.standard.value===s)return i.standard}return null}createOffsetObject(t){let e=t.offset<0?"-":"+",r=Math.abs(t.offset),s=Math.trunc(r),i=Math.round(r%1*60),a=`${e}${String(s+(i===60?1:0)).padStart(2,"0")}:${String(i%60).padStart(2,"0")}`;return{label:t.name,abbr:t.abbr,value:a}}getTimezoneOffsets(){let t=it(this.getTimeZone());if(t.length===0)return{standard:{label:"Etc/UTC",abbr:"Etc/UTC",value:"+00:00"}};let{daylight:e,standard:r}=t[0];return e?{daylight:this.createOffsetObject(e),standard:this.createOffsetObject(r)}:{standard:this.createOffsetObject(r)}}},Ut=new c(A),$t=new c(P,!0),Nt=new c(v),Lt=new c(M,!0);import{immerable as nt}from"immer";var g=class n{[nt]=!0;_prefix;_name;_value;_isModUIParameter=!1;constructor(t,e,r){this._prefix=t,this._name=e??"",r!==null&&(this._value=typeof r=="string"?decodeURIComponent(r):r),e&&this.setIsModUIParameter(e)}get prefix(){return this._prefix}get name(){return this._name}get value(){return this._value}static fromString(t){if(t==null||t===""||!t.includes("="))return new n;let e=t.split("=");return n.fromURLSearchParam(e[0],e[1])}static fromURLSearchParam(t,e){if(t.includes(m)){let r=t.substring(0,t.indexOf("~")),s=t.substring(t.indexOf("~")+1);return new n(r,s,e)}return new n(void 0,t,e)}toString(t=!0){if(!this.name)return"";let e=this.value==null?"":this.value;return t&&this.prefix?`${this.prefix}${m}${this.name}=${e}`:`${this.name}=${e}`}toQuerystring(t=!0){let e=this.value==null?"":this.paramValueToQuerystring(this.value);return t&&this.prefix?`${this.prefix}${m}${this.name}=${e}`:`${this.name}=${e}`}paramValueToQuerystring(t){return typeof t=="number"||typeof t=="string"||typeof t=="boolean"?encodeURIComponent(t):Array.isArray(t)?t.filter(e=>e!=null).map(e=>this.paramValueToQuerystring(e)).join(","):JSON.stringify(t)}get isModUIParameter(){return this._isModUIParameter}setIsModUIParameter(t){let e=k("UI_PARAMETERS",[]);Array.isArray(e)&&(this._isModUIParameter=!e.includes(t))}};var l=class n extends f{static fromSearch(t){let e=new n;return new URLSearchParams(t).forEach((s,i)=>{e.add(g.fromURLSearchParam(i,s))}),e}static fromUrl(t){let e=new n;return t.includes("?")&&t.split("?")[1].split("&").forEach(r=>{e.add(g.fromString(r))}),e}asQuerystring(t=!1){return this.collection.filter(e=>e.value!=null&&e.value!=="").map(e=>e.toQuerystring(t)).join("&")}asQueryStringForModularUI(t=""){return this.collection.filter(e=>e.isModUIParameter&&(!t||!e.prefix||e.prefix===t)&&e.value!=null).map(e=>e.toQuerystring(!1)).join("&")}removeParameter(t,e,r){if(r!==void 0){let s=r;this.collection=this.collection.map(i=>{if(i.prefix===e&&i.name===t){let a;return typeof i.value=="string"?a=i.value.split(",").filter(o=>o!==s).join(","):a=i.value===r?null:r,new g(i.prefix,i.name,a)}return i})}else this.collection=this.collection.filter(s=>s.prefix!==e||s.name!==t);return this}};import{immerable as at}from"immer";var j=class n{[at]=!0;_origin="";_contextPath=U();_path="";_hash="";_parameters=new l;_resourcetype;_method="GET";_state;_referenceHash;constructor(t,e,r){this._resourcetype=e??"",typeof t=="string"?this.initializeFromString(t):t instanceof n?this.initializeFromHref(t):t&&this.initializeFromLocation(t),typeof r?.origin=="string"&&(this.origin=r.origin),typeof r?.contextPath=="string"&&(this.contextPath=r.contextPath)}initializeFromString(t){this._path=n.getPathFromString(t),this._parameters=l.fromUrl(t),this._hash=n.getHashFromString(t)}initializeFromHref(t){this._origin=t.origin,this._contextPath=t.contextPath,this._path=t.path,this._parameters=t.parameters,this._hash=t.hash,this._state=t.state}initializeFromLocation(t){this._path=t.pathname??"",this._parameters=l.fromSearch(t.search),this._hash=t.hash??"",this.initializeStateFromLocation(t)}initializeStateFromLocation(t){t.state instanceof Object&&(this._state=t.state,this._origin="origin"in t.state&&typeof t.state.origin=="string"?t.state.origin:"",this._contextPath="contextPath"in t.state&&typeof t.state.contextPath=="string"?t.state.contextPath:"")}get key(){return Math.random().toString(36).substring(2,10)}get origin(){return this._origin}set origin(t){this._origin=t}get contextPath(){return this._contextPath}set contextPath(t){this._contextPath=t}get path(){return this._path||""}set path(t){this._path=t}get parameters(){return this._parameters}set parameters(t){this._parameters=t}get hash(){return this._hash}set hash(t){this._hash=t}get state(){return this._state}set state(t){this._state=t}setState(t){return this.state=t,this}get method(){return this._method}set method(t){this._method=t||"GET"}set resourcetype(t){this._resourcetype=t}get resourcetype(){return this._resourcetype}get isChangePassword(){return this.path.includes("/change-password")}get isExternal(){return n.checkAbsoluteUrl(this.path)}addParameter(t,e,r){return e!==null&&(this.parameters.removeParameter(t,r),this.parameters.add(new g(r,t,e))),this}setParameter(t,e,r){return e!=null?this.addParameter(t,e,r):this.parameters.removeParameter(t,r),this}removeParameter(t,e,r){return this.parameters.removeParameter(t,e,r),this}getParameter(t,e){return this.parameters.find(r=>r.prefix===e&&r.name===t)}hasParameter(t,e){return this.getParameter(t,e)!==void 0}getQuerystring(t=!1){return this.parameters.asQuerystring(t)}getQuerystringForModularUI(t=""){return this.parameters.asQueryStringForModularUI(t)}get querystring(){return this.parameters.asQuerystring(!1)}get absolutepath(){return this.isExternal?this.path:this.origin+this.contextPath+this.path}get href(){return this.querystring.length>0?[this.path,this.querystring].join("?"):this.path}get absolutehref(){let t=this.getQuerystring(!1);return t.length>0?[this.absolutepath,t].join("?"):this.absolutepath}get absolutehrefPrefixedQuerystring(){let t=this.getQuerystring(!0);return t.length>0?[this.absolutepath,t].join("?"):this.absolutepath}startsWith(t){let e=`${this.path}/`,r=t instanceof n?`${t.path}/`:t;return e.startsWith(r)}equals(t){return t instanceof n?this.path===t.path:this.path===t}equalsWithParameters(t){if(t==null)return!1;let e=t instanceof n?t:new n(t);if(!this.equals(e)||this.parameters.length!==e.parameters.length)return!1;if(this.parameters.length===0&&e.parameters.length===0)return!0;let r=this.parameters.map(s=>s.toString());return e.parameters.every(s=>r.includes(s.toString()))}get isContent(){return this.absolutepath.startsWith($())}getReferenceHash(){return this._referenceHash}setReferenceHash(t){this._referenceHash=t}toString(){return this.href}toLocation(){let t=this.state instanceof Object?this.state:{};return{key:this.key,pathname:this.path,search:this.querystring.length>0?`?${this.querystring}`:"",hash:this.hash.length>0?`#${this.hash}`:"",state:{origin:this.origin,contextPath:this.contextPath,...t}}}static getPathFromString(t){return t.split("#")[0].split("?")[0]}static getHashFromString(t){return t.includes("#")?t.substring(t.indexOf("#")+1):""}static isCamelRoute(t){return t.startsWith("/restServices")&&!t.startsWith("/restServices/ui")}static checkAbsoluteUrl(t){return new RegExp("^(?:[a-z]+:)?//","i").test(t)}};import I from"hash-it";var se=n=>I(n),ie=(n,t)=>{if(n==null)return 0;let e=n.hash?[n.toString(),n.hash].join("#"):n.toString();return t?I({hrefString:e,fragment:t}):I(e)};var ae=n=>{if(typeof n=="string")return n;if(typeof n=="object"&&"message"in n&&typeof n.message=="string")return n.message};var d=class n{_prefix="";_suffix="";_comma=0;_minInt=1;_minFrac=0;_maxFrac=0;_isPercentage=!1;constructor(t){this.setAffix(t),this.setFractionLengths(t),this.setGroupLength(t),this.setMinLength(t),this.setPercentage()}get prefix(){return this._prefix}get suffix(){return this._suffix}get comma(){return this._comma}get minInt(){return this._minInt}get minFrac(){return this._minFrac}get maxFrac(){return this._maxFrac}get isPercentage(){return this._isPercentage}setAffix(t){let e=t.includes("#")?t.substring(0,t.indexOf("#")):t;this._prefix=e.includes("0")?e.substring(0,e.indexOf("0")):e,this._suffix=t.substring(this._prefix.length).replace(/[#,.0]/gu,"")}setFractionLengths(t){let e=t.replace(/[^#,.0]/gu,"");if(e.includes(".")){let s=e.substring(e.indexOf(".")+1).replace(/,|\.+/g,"");this._maxFrac=s.length;let i=s.replace(/[^0]/gu,"");this._minFrac=i.length}}setGroupLength(t){let e=t.replace(/[^#,.0]/gu,""),r=e.includes(".")?e.substring(0,e.indexOf(".")):e;r.includes(",")&&(this._comma=r.length-1-r.lastIndexOf(","))}setMinLength(t){let r=(t.includes(".")?t.substring(0,t.indexOf(".")):t).replace(/[^0]/gu,"");this._minInt=r.length>1?r.length:1}setPercentage(){this._isPercentage=this.suffix.charAt(0)==="%"}static getNumericString(t){let e=Number(t),r=String(e);return!r.includes(".")&&t.includes(".")?t.substring(t.indexOf(".")+1).replace(/0/gu,"").length>0?t:r:t}formatBack(t){let e=String(t);if(!e)return"";if(!isNaN(Number(e)))return n.getNumericString(e);let r=t,s=!1;t.charAt(0)==="-"&&(r=t.substr(1),s=!0);let i=t.startsWith(this.prefix),a=this.suffix===""?t.length:t.indexOf(this.suffix,this.prefix.length+1);return i&&a>0&&(r=r.substr(0,a),r=r.substr(this.prefix.length),r=r.replace(/,/gu,""),s&&(r=`-${r}`),!isNaN(Number(r)))?n.getNumericString(r):r}static scientificNumber(t){if(t.includes("e")){let e=Number(t);return e===1/0||e===-1/0?t:String(e)}return t}getFracAsNumber(t){let e=+`0.${t}`;return this.maxFrac===0?Math.round(e).toString(10):e.toFixed(this.maxFrac)}getRoundedFrac(t){return this.getFracAsNumber(t).substr(2)}static getFraction(t){let e=t.includes(".")?t.substring(t.indexOf(".")+1):"";return e=e.replace(/\./,""),e}getFracCorrectLength(t){let e=t;e.length>this.maxFrac&&(e=this.getRoundedFrac(e));for(let r=e.length;r<this.minFrac;r++)e=`${e}0`;for(;e.length>this.minFrac&&e.charAt(e.length-1)==="0";)e=e.substring(0,e.length-1);return e}getInteger(t){let e=t.includes(".")?t.substring(0,t.indexOf(".")):t,r=Number(this.getFracAsNumber(t))>1,s=e.length-1;for(;r;){if(s===-1){e=`1${e}`;break}let i=e.charAt(s);i==="9"?i="0":(i=`${i+1}`,r=!1),e=e.substring(0,s)+i+e.substring(s+1,e.length),s-=1}for(let i=e.length;i<this.minInt;i++)e=`0${e}`;for(;e.length>this.minInt&&e.charAt(0)==="0";)e=e.substring(1);return e}addGrouping(t){let e=t,r=0;for(let s=e.length;s>0;s--)r!==0&&r%this.comma===0&&(e=`${e.substring(0,s)},${e.substring(s)}`,r=0),r+=1;return e}getFormattedValue(t,e,r){let s;return e.length>0?s=`${this.prefix+t}.${e}${this.suffix}`:s=this.prefix+t+this.suffix,r&&(s=`-${s}`),s}format(t=""){if(t===null)return"";let e=this.formatBack(t).toLowerCase();if(isNaN(Number(e))||e.length===0)return t;if(e=n.scientificNumber(e),e.includes("e"))return e;let r=e.charAt(0)==="-";(r||e.charAt(0)==="+")&&(e=e.substring(1));let s=n.getFraction(e),i=this.getInteger(e);if(this.isPercentage){let o=`00${`${s}00`.substr(0,2)}`.substr(-2);i=`${i}${o}`,s=s.substr(2)}return s=this.getFracCorrectLength(s),i=this.addGrouping(i),this.getFormattedValue(i,s,r)}};import ot from"big.js";var Z=class{static removeGroupingSeparator=(t,e)=>{if(typeof t=="number"||e==null)return t;let r=e.replace(/[$()*+.?[\\\]^{|}]/g,"\\$&");return t.replace(new RegExp(r,"g"),"")};static updateDecimalSeparator=(t,e)=>typeof t=="number"||e==null||e===""?t:t.replace(e,".");static parseToNumber=(t,e=",",r=".")=>{if(!(typeof t=="number"||typeof t=="string")||t==="")return NaN;let s=this.removeGroupingSeparator(t,e),i=this.updateDecimalSeparator(s,r);return Number(i)};static parseNumberToString=(t,e=",",r=".")=>{if(t==null||t==="")return"NaN";let s=this.removeGroupingSeparator(t,e),i=this.updateDecimalSeparator(s,r);try{return ot(i).toFixed()}catch{return"NaN"}};static updateGroupingSeparator(t,e){return e==null?t:t.replace(/,/g,e)}static formatNumber(t,e="#",r=",",s="."){if(t==null)return"";let i=typeof t=="number"?t:this.parseToNumber(t,r,s);if(typeof i!="number")throw new w(`Not a valid number: ${t} for formatValue`);let a=this.parseNumberToString(i);if(e!=null){let o=new d(e).format(a),[b,_]=o.split("."),T=this.updateGroupingSeparator(b,r);return _?`${T}${s}${_}`:T}return a}static isSameOrBefore(t,e){return t<=e}static isBefore(t,e){return t<e}};export{f as a,N as b,lt as c,mt as d,c as e,Ut as f,$t as g,Nt as h,Lt as i,g as j,l as k,j as l,se as m,ie as n,ae as o,d as p,Z as q};
2
- //# sourceMappingURL=chunk-BODVDNNA.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/models/base/BaseCollection.ts","../src/utils/storage/Cookies.ts","../src/utils/datetime/DateTimeUtil.ts","../src/models/parameter/Parameter.ts","../src/models/parameter/ParameterCollection.ts","../src/models/href/Href.ts","../src/utils/helpers/createHash.ts","../src/utils/helpers/text.ts","../src/utils/number/DecimalFormat.ts","../src/utils/number/NumberUtil.ts"],"sourcesContent":["import { immerable } from \"immer\";\n\nexport abstract class BaseCollection<T> {\n [immerable] = true;\n\n private _collection: T[];\n\n constructor(collection: T[] = []) {\n this._collection = collection;\n }\n\n get collection() {\n return this._collection;\n }\n\n set collection(collection: T[]) {\n this._collection = collection;\n }\n\n /**\n * Retrieve all items in collection\n */\n get all() {\n return this.collection;\n }\n\n /**\n * Add an other collection, array of items or single item to this collection;\n */\n add(items: BaseCollection<T> | T[] | T) {\n if (items instanceof BaseCollection) {\n this.collection = [...this.collection, ...items.all];\n } else if (Array.isArray(items)) {\n this.collection = [...this.collection, ...items];\n } else {\n this.collection = [...this.collection, items];\n }\n }\n\n /**\n * Remove an item from the collection by it's index.\n */\n removeByIndex(itemIndex: number) {\n if (itemIndex > -1) {\n this.collection = [\n ...this.collection.slice(0, itemIndex),\n ...this.collection.slice(itemIndex + 1),\n ];\n }\n }\n\n /**\n * Indicates if the collection has items\n */\n hasItems() {\n return this.length > 0;\n }\n\n /**\n * Indicates if collection is empty\n */\n isEmpty() {\n return !this.hasItems();\n }\n\n /**\n * Get the size of this collection\n */\n get length() {\n return this.collection.length;\n }\n\n /**\n * Get the size of this collection\n */\n get size() {\n return this.length;\n }\n\n /**\n * Return first item in collection\n */\n get first() {\n return this.collection[0];\n }\n\n /**\n * Return last item in collection\n */\n get last() {\n return this.collection[this.collection.length - 1];\n }\n\n /**\n * Return item by index\n */\n get(index: number) {\n return this.collection[index];\n }\n\n /**\n * Find an item, @see {Array#find}\n */\n find(\n callbackfn: (value: T, index: number, obj: T[]) => unknown,\n thisArg?: unknown,\n ) {\n return this.collection.find(callbackfn, thisArg);\n }\n\n /**\n * Filter collection by function\n */\n filter(\n callbackfn: (value: T, index: number, array: T[]) => unknown,\n thisArg?: unknown,\n ) {\n return this.collection.filter(callbackfn, thisArg);\n }\n\n /**\n * Check if at least one item occurs\n */\n some(\n callbackfn: (value: T, index: number, array: T[]) => unknown,\n thisArg?: unknown,\n ) {\n return this.collection.some(callbackfn, thisArg);\n }\n\n every(\n callbackfn: (value: T, index: number, array: T[]) => unknown,\n thisArg?: unknown,\n ) {\n return this.collection.every(callbackfn, thisArg);\n }\n\n map<U>(\n callbackfn: (value: T, index: number, array: T[]) => U,\n thisArg?: unknown,\n ) {\n return this.collection.map(callbackfn, thisArg);\n }\n\n forEach(\n callbackfn: (value: T, index: number, array: T[]) => void,\n thisArg?: unknown,\n ) {\n this.collection.forEach(callbackfn, thisArg);\n }\n\n sort(compareFn?: (a: T, b: T) => number) {\n return this.collection.sort(compareFn);\n }\n\n /**\n * Retrieve an alphabetically sorted array of items\n */\n get sorted() {\n return this.collection.sort();\n }\n\n clear() {\n this.collection = [];\n }\n}\n","import Cookies from \"js-cookie\";\n\nimport { getContextPathServer } from \"../../settings/Paths\";\n\ninterface CookieOptions {\n days?: number;\n sameSite?: \"None\" | \"Lax\" | \"Strict\";\n secure?: boolean;\n}\n\nexport const getCookie = (name: string) => {\n return Cookies.get(name);\n};\n\nexport const setCookie = (\n name: string,\n value: string,\n options?: CookieOptions,\n) => {\n const attributes = {\n path: getContextPathServer(),\n expires: options?.days,\n sameSite: options?.sameSite ?? \"Strict\",\n secure: options?.secure,\n };\n\n Cookies.set(name, value, attributes);\n};\n\nexport const clearCookie = (name: string) => {\n Cookies.remove(name, { path: getContextPathServer() });\n};\n","import { tz } from \"@date-fns/tz/tz\";\nimport { add } from \"date-fns/add\";\nimport { endOfMonth } from \"date-fns/endOfMonth\";\nimport { format } from \"date-fns/format\";\nimport { getDay } from \"date-fns/getDay\";\nimport { getHours } from \"date-fns/getHours\";\nimport { getMinutes } from \"date-fns/getMinutes\";\nimport { getWeek } from \"date-fns/getWeek\";\nimport { isAfter } from \"date-fns/isAfter\";\nimport { isBefore } from \"date-fns/isBefore\";\nimport { isSameDay } from \"date-fns/isSameDay\";\nimport { isValid } from \"date-fns/isValid\";\nimport { enGB, nl } from \"date-fns/locale\";\nimport { parse } from \"date-fns/parse\";\nimport { set } from \"date-fns/set\";\nimport { startOfMonth } from \"date-fns/startOfMonth\";\nimport { startOfWeek } from \"date-fns/startOfWeek\";\nimport { sub } from \"date-fns/sub\";\nimport soft from \"timezone-soft\";\n\nimport {\n DATETIME_OFFSET_FORMAT,\n DEFAULT_FIRST_WEEK_CONTAINS_DATE,\n DEFAULT_WEEK_STARTS_ON,\n IS_GRAALJS,\n ISO_DATE_FORMAT,\n ISO_DATETIME_FORMAT,\n ISO_TIME_FORMAT,\n ISO_TIMESTAMP_FORMAT,\n} from \"../../constants/Constants\";\nimport {\n getEnabledLocales,\n getNumberSetting,\n isIncludeTimeOffsetInDateTimes,\n} from \"../../settings/Settings\";\nimport { getCookie } from \"../storage/Cookies\";\n\nimport type {\n ContextOptions,\n DateValues,\n Duration,\n FirstWeekContainsDate,\n SetOptions,\n} from \"date-fns\";\nimport type { TimeZoneInfo } from \"timezone-soft\";\n\ninterface OffsetInfoInput extends TimeZoneInfo {\n offset: number;\n}\n\nexport interface OffsetInfo {\n abbr: string;\n label: string;\n value: string;\n}\n\nexport class BaseDateTimeUtil {\n private _isoFormat: string;\n private _doOffsets: boolean;\n\n private _timeZone: string =\n typeof Intl === \"undefined\"\n ? \"Etc/UTC\"\n : Intl.DateTimeFormat().resolvedOptions().timeZone || \"Etc/UTC\";\n\n constructor(isoFormat: string, doOffsets = false) {\n this._isoFormat = isoFormat;\n this._doOffsets = doOffsets;\n }\n\n /**\n * Indicates if offsets and timezones are relevant\n */\n get doOffsets() {\n return this._doOffsets ? isIncludeTimeOffsetInDateTimes() : false;\n }\n\n /**\n * Returns the options defined in settings\n */\n getOptions(): {\n weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6;\n firstWeekContainsDate?: FirstWeekContainsDate;\n } {\n // indicates on what day the week starts\n const weekStartsOn = getNumberSetting(\n \"CALENDAR_WEEK_STARTS_ON\",\n DEFAULT_WEEK_STARTS_ON,\n );\n\n // indicates which date indicates the first week of the year\n const firstWeekContainsDate = getNumberSetting(\n \"CALENDAR_FIRST_WEEK_CONTAINS_DATE\",\n DEFAULT_FIRST_WEEK_CONTAINS_DATE,\n );\n\n return {\n weekStartsOn:\n weekStartsOn > -1 && weekStartsOn < 7\n ? (weekStartsOn as 0 | 1 | 2 | 3 | 4 | 5 | 6)\n : undefined,\n firstWeekContainsDate:\n firstWeekContainsDate === 1 || firstWeekContainsDate === 4\n ? (firstWeekContainsDate as FirstWeekContainsDate)\n : undefined,\n };\n }\n\n getIsoFormat() {\n if (this.doOffsets) {\n return this._isoFormat + DATETIME_OFFSET_FORMAT;\n }\n return this._isoFormat;\n }\n\n convertFormat(javaFormat?: string) {\n if (!javaFormat) {\n return this.getIsoFormat();\n }\n\n const javaToUTS35Map: Record<string, string> = {\n ZZZ: \"xxx\",\n ZZ: \"xx\",\n Z: \"x\",\n };\n\n // Replace Java pattern tokens with UTS #35 tokens\n let uts35Format = javaFormat;\n\n // Sort keys by length (descending) to handle multi-character tokens first\n const sortedKeys = Object.keys(javaToUTS35Map).sort(\n (a, b) => b.length - a.length,\n );\n\n for (const javaToken of sortedKeys) {\n const uts35Token = javaToUTS35Map[javaToken];\n const regex = new RegExp(javaToken, \"g\"); // Match all occurrences\n uts35Format = uts35Format.replace(regex, uts35Token);\n }\n\n return uts35Format;\n }\n\n getLocale() {\n const defaultLocale = getEnabledLocales()[0];\n const locale = getCookie(\"locale\") ?? defaultLocale ?? \"en\";\n\n if (locale === \"nl\") {\n return nl;\n }\n\n return enGB;\n }\n\n toDate(date: string | Date, inputFormat: string = this.getIsoFormat()) {\n if (date instanceof Date) {\n return date;\n }\n\n const { weekStartsOn, firstWeekContainsDate } = this.getOptions();\n\n return parse(date, inputFormat, new Date(), {\n in: this.getDateFnsContext(),\n weekStartsOn,\n firstWeekContainsDate,\n });\n }\n\n toFormat(\n date: string | Date,\n targetFormat: string,\n inputFormat: string = this.getIsoFormat(),\n ) {\n const { weekStartsOn } = this.getOptions();\n\n const parsedDate = this.toDate(date, inputFormat);\n\n if (isValid(parsedDate)) {\n return format(parsedDate, targetFormat, {\n in: this.getDateFnsContext(),\n weekStartsOn,\n locale: this.getLocale(),\n });\n }\n\n return \"Invalid Date\";\n }\n\n toISO(date: string | Date, sourceFormat: string = this.getIsoFormat()) {\n return this.toFormat(date, this.getIsoFormat(), sourceFormat);\n }\n\n now() {\n return this.toISO(new Date());\n }\n\n //////////// VALIDATION\n\n hasFormat(date: string, sourceFormat: string) {\n const parsedDate = this.toDate(date, sourceFormat);\n\n const formattedValue = this.toFormat(parsedDate, sourceFormat);\n if (formattedValue === \"Invalid Date\") {\n return false;\n }\n\n const isOutsideRange =\n isBefore(parsedDate, new Date(1000, 1, 1)) ||\n isAfter(parsedDate, new Date(9999, 11, 31));\n if (isOutsideRange) {\n return false;\n }\n\n return (\n formattedValue.replace(/0/gu, \"\").toUpperCase() ===\n date.replace(/0/gu, \"\").toUpperCase()\n );\n }\n\n isValid(\n date: string | Date | null | void,\n inputFormat: string = this.getIsoFormat(),\n ) {\n if (!date) {\n return false;\n }\n\n const parsedDate = this.toDate(date, inputFormat);\n return isValid(parsedDate);\n }\n\n isAfter(\n inputDate: string | Date,\n afterISODate?: string | Date,\n inputFormat: string = this.getIsoFormat(),\n ) {\n if (!afterISODate) {\n return false;\n }\n return isAfter(\n this.toDate(inputDate, inputFormat),\n this.toDate(afterISODate),\n );\n }\n\n isSameOrAfter(\n inputDate: string | Date,\n afterISODate?: string | Date,\n inputFormat: string = this.getIsoFormat(),\n ) {\n if (!afterISODate) {\n return false;\n }\n return (\n this.isAfter(inputDate, afterISODate, inputFormat) ||\n this.isSame(inputDate, afterISODate, inputFormat)\n );\n }\n\n isBefore(\n inputDate: string | Date,\n beforeISODate?: string | Date,\n inputFormat: string = this.getIsoFormat(),\n ) {\n if (!beforeISODate) {\n return false;\n }\n\n return isBefore(\n this.toDate(inputDate, inputFormat),\n this.toDate(beforeISODate),\n );\n }\n\n isSameOrBefore(\n inputDate: string | Date,\n beforeISODate?: string | Date,\n inputFormat: string = this.getIsoFormat(),\n ) {\n if (!beforeISODate) {\n return false;\n }\n\n return (\n this.isBefore(inputDate, beforeISODate, inputFormat) ||\n this.isSame(inputDate, beforeISODate, inputFormat)\n );\n }\n\n isSame(\n inputDate: string | Date,\n compareDate?: string | Date,\n inputFormat: string = this.getIsoFormat(),\n ) {\n if (!compareDate) {\n return false;\n }\n\n return (\n this.toDate(inputDate, inputFormat).getTime() ===\n this.toDate(compareDate).getTime()\n );\n }\n\n isSameDay(\n inputDate: string | Date,\n compareDate?: string | Date,\n inputFormat: string = this.getIsoFormat(),\n ) {\n if (!compareDate) {\n return false;\n }\n\n return isSameDay(\n this.toDate(inputDate, inputFormat),\n this.toDate(compareDate, inputFormat),\n );\n }\n\n isOther(\n inputDate: string | Date,\n compareDate?: string | Date,\n inputFormat: string = this.getIsoFormat(),\n ) {\n return !this.isSame(inputDate, compareDate, inputFormat);\n }\n\n isWeekend(inputDate: string | Date) {\n const SATURDAY_NUMBER = 6;\n const SUNDAY_NUMBER = 0;\n const weekDay = getDay(this.toDate(inputDate));\n\n return weekDay === SATURDAY_NUMBER || weekDay === SUNDAY_NUMBER;\n }\n\n /**\n * Checks if a given local date and time is ambiguous in the specified timezone.\n * Ambiguity happens during the end of daylight saving time (DST) transitions.\n */\n isAmbiguous(\n inputDate?: string | Date | null,\n inputFormat: string = this.getIsoFormat(),\n ) {\n if (inputDate == null || typeof Intl === \"undefined\") {\n return false;\n }\n\n const dateTime = this.toDate(inputDate, inputFormat);\n if (!isValid(dateTime)) {\n return false;\n }\n\n const t = [60, -60, 30, -30];\n const a = t.map((x) => {\n const newDate = add(dateTime, { minutes: x });\n return format(newDate, \"HH:mm\");\n });\n const time = format(dateTime, \"HH:mm\");\n return a.indexOf(time) > -1;\n }\n\n //////////// CALCULATIONS\n\n private calculate(\n date: string | Date,\n calculationFn: (\n date: Date,\n duration: Duration,\n options: ContextOptions<Date>,\n ) => Date,\n property: string,\n value: number,\n inputFormat: string = this.getIsoFormat(),\n ) {\n const parsedDate = this.toDate(date, inputFormat);\n return this.toISO(\n calculationFn(\n parsedDate,\n { [property]: value },\n {\n in: this.getDateFnsContext(),\n },\n ),\n );\n }\n\n addSeconds(\n date: string,\n amount: number,\n inputFormat: string = this.getIsoFormat(),\n ) {\n return this.calculate(date, add, \"seconds\", amount, inputFormat);\n }\n\n addMinutes(\n date: string,\n amount: number,\n inputFormat: string = this.getIsoFormat(),\n ) {\n return this.calculate(date, add, \"minutes\", amount, inputFormat);\n }\n\n addHours(\n date: string,\n amount: number,\n inputFormat: string = this.getIsoFormat(),\n ) {\n return this.calculate(date, add, \"hours\", amount, inputFormat);\n }\n\n addDays(\n date: string,\n amount: number,\n inputFormat: string = this.getIsoFormat(),\n ) {\n return this.calculate(date, add, \"days\", amount, inputFormat);\n }\n\n addWeeks(\n date: string,\n amount: number,\n inputFormat: string = this.getIsoFormat(),\n ) {\n return this.calculate(date, add, \"weeks\", amount, inputFormat);\n }\n\n addMonths(\n date: string,\n amount: number,\n inputFormat: string = this.getIsoFormat(),\n ) {\n return this.calculate(date, add, \"months\", amount, inputFormat);\n }\n\n addYears(\n date: string,\n amount: number,\n inputFormat: string = this.getIsoFormat(),\n ) {\n return this.calculate(date, add, \"years\", amount, inputFormat);\n }\n\n subtractSeconds(\n date: string,\n amount: number,\n inputFormat: string = this.getIsoFormat(),\n ) {\n return this.calculate(date, sub, \"seconds\", amount, inputFormat);\n }\n\n subtractMinutes(\n date: string,\n amount: number,\n inputFormat: string = this.getIsoFormat(),\n ) {\n return this.calculate(date, sub, \"minutes\", amount, inputFormat);\n }\n\n subtractHours(\n date: string,\n amount: number,\n inputFormat: string = this.getIsoFormat(),\n ) {\n return this.calculate(date, sub, \"hours\", amount, inputFormat);\n }\n\n subtractDays(\n date: string,\n amount: number,\n inputFormat: string = this.getIsoFormat(),\n ) {\n return this.calculate(date, sub, \"days\", amount, inputFormat);\n }\n\n subtractWeeks(\n date: string,\n amount: number,\n inputFormat: string = this.getIsoFormat(),\n ) {\n return this.calculate(date, sub, \"weeks\", amount, inputFormat);\n }\n\n subtractMonths(\n date: string,\n amount: number,\n inputFormat: string = this.getIsoFormat(),\n ) {\n return this.calculate(date, sub, \"months\", amount, inputFormat);\n }\n\n subtractYears(\n date: string,\n amount: number,\n inputFormat: string = this.getIsoFormat(),\n ) {\n return this.calculate(date, sub, \"years\", amount, inputFormat);\n }\n\n //////////// GETTERS\n\n private get(\n date: string | Date,\n method: (date: Date, options: ContextOptions<Date>) => Date,\n inputFormat: string = this.getIsoFormat(),\n options: object = {},\n ) {\n const parsedDate = this.toDate(date, inputFormat);\n return this.toISO(\n method(parsedDate, {\n in: this.getDateFnsContext(),\n ...options,\n }),\n );\n }\n\n startOfMonth(date: string | Date, inputFormat: string = this.getIsoFormat()) {\n return this.get(date, startOfMonth, inputFormat);\n }\n\n endOfMonth(date: string | Date, inputFormat: string = this.getIsoFormat()) {\n return this.get(date, endOfMonth, inputFormat);\n }\n\n startOfWeek(date: string | Date, inputFormat: string = this.getIsoFormat()) {\n const { weekStartsOn } = this.getOptions();\n return this.get(date, startOfWeek, inputFormat, {\n weekStartsOn,\n });\n }\n\n getHours(date: string | Date, inputFormat: string = this.getIsoFormat()) {\n const parsedDate = this.toDate(date, inputFormat);\n return getHours(parsedDate, { in: this.getDateFnsContext() });\n }\n\n getMinutes(date: string | Date, inputFormat: string = this.getIsoFormat()) {\n const parsedDate = this.toDate(date, inputFormat);\n return getMinutes(parsedDate, { in: this.getDateFnsContext() });\n }\n\n getWeek(date: string | Date, inputFormat: string = this.getIsoFormat()) {\n const { weekStartsOn, firstWeekContainsDate } = this.getOptions();\n const parsedDate = this.toDate(date, inputFormat);\n return getWeek(parsedDate, {\n in: this.getDateFnsContext(),\n weekStartsOn,\n firstWeekContainsDate,\n });\n }\n\n //////////// SETTERS\n\n private set(\n date: string | Date,\n property: string,\n value: number,\n inputFormat: string = this.getIsoFormat(),\n ) {\n const parsedDate = this.toDate(date, inputFormat);\n return this.toISO(set(parsedDate, { [property]: value } as DateValues));\n }\n\n setYear(\n date: string | Date,\n year: number,\n inputFormat: string = this.getIsoFormat(),\n ) {\n return this.set(date, \"year\", year, inputFormat);\n }\n\n setMonth(\n date: string | Date,\n month: number,\n inputFormat: string = this.getIsoFormat(),\n ) {\n return this.set(date, \"month\", month, inputFormat);\n }\n\n setDay(\n date: string | Date,\n day: number,\n inputFormat: string = this.getIsoFormat(),\n ) {\n return this.set(date, \"date\", day, inputFormat);\n }\n\n setHour(\n date: string | Date,\n hour: number,\n inputFormat: string = this.getIsoFormat(),\n ) {\n return this.set(date, \"hours\", hour, inputFormat);\n }\n\n setMinute(\n date: string | Date,\n minute: number,\n inputFormat: string = this.getIsoFormat(),\n ) {\n return this.set(date, \"minutes\", minute, inputFormat);\n }\n\n setSecond(\n date: string | Date,\n second: number,\n inputFormat: string = this.getIsoFormat(),\n ) {\n return this.set(date, \"seconds\", second, inputFormat);\n }\n\n setMilliseconds(\n date: string | Date,\n millisecond: number,\n inputFormat: string = this.getIsoFormat(),\n ) {\n return this.set(date, \"milliseconds\", millisecond, inputFormat);\n }\n\n setTime(\n date: string,\n hours: number,\n minutes: number,\n seconds: number,\n milliseconds: number,\n inputFormat: string = this.getIsoFormat(),\n ) {\n const parsedDate = this.toDate(date, inputFormat);\n return this.toISO(\n set(\n parsedDate,\n { hours, minutes, seconds, milliseconds } as DateValues,\n {\n in: this.getDateFnsContext(),\n } as SetOptions,\n ),\n );\n }\n\n //////////// Timezone related\n\n getTimeZone() {\n return this._timeZone;\n }\n\n setTimeZone(timeZone: string) {\n this._timeZone = timeZone;\n }\n\n getDateFnsContext() {\n if (this.doOffsets && !IS_GRAALJS) {\n return tz(this.getTimeZone());\n }\n return undefined;\n }\n\n //////////// Offsets\n\n getOffset(date: string | Date, inputFormat: string = this.getIsoFormat()) {\n const parsedDate = this.toDate(date, inputFormat);\n if (isValid(parsedDate)) {\n const dateOffset = this.toFormat(parsedDate, DATETIME_OFFSET_FORMAT);\n const offsets = this.getTimezoneOffsets();\n if (\n typeof offsets.daylight !== \"undefined\" &&\n offsets.daylight.value === dateOffset\n ) {\n return offsets.daylight;\n } else if (\n typeof offsets.standard !== \"undefined\" &&\n offsets.standard.value === dateOffset\n ) {\n return offsets.standard;\n }\n }\n return null;\n }\n\n private createOffsetObject(info: OffsetInfoInput) {\n const sign = info.offset < 0 ? \"-\" : \"+\";\n const absOffset = Math.abs(info.offset);\n const hours = Math.trunc(absOffset);\n const minutes = Math.round((absOffset % 1) * 60);\n\n const offsetString = `${sign}${String(hours + (minutes === 60 ? 1 : 0)).padStart(2, \"0\")}:${String(minutes % 60).padStart(2, \"0\")}`;\n\n return {\n label: info.name,\n abbr: info.abbr,\n value: offsetString,\n };\n }\n\n getTimezoneOffsets(): {\n standard?: OffsetInfo;\n daylight?: OffsetInfo;\n } {\n const timezone = soft(this.getTimeZone());\n\n if (timezone.length === 0) {\n return {\n standard: {\n label: \"Etc/UTC\",\n abbr: \"Etc/UTC\",\n value: \"+00:00\",\n },\n };\n }\n\n const { daylight, standard } = timezone[0];\n\n if (daylight) {\n return {\n daylight: this.createOffsetObject(daylight as OffsetInfoInput),\n standard: this.createOffsetObject(standard as OffsetInfoInput),\n };\n }\n\n return { standard: this.createOffsetObject(standard as OffsetInfoInput) };\n }\n}\n\n/**\n * DateUtil\n */\nconst DateUtil = new BaseDateTimeUtil(ISO_DATE_FORMAT);\n\n/**\n * DateTimeUtil\n */\nconst DateTimeUtil = new BaseDateTimeUtil(ISO_DATETIME_FORMAT, true);\n\n/**\n * TimeUtil\n */\nconst TimeUtil = new BaseDateTimeUtil(ISO_TIME_FORMAT);\n\n/**\n * TimestampUtil\n */\nconst TimestampUtil = new BaseDateTimeUtil(ISO_TIMESTAMP_FORMAT, true);\n\nexport { DateUtil, DateTimeUtil, TimeUtil, TimestampUtil };\n","import { immerable } from \"immer\";\n\nimport { PARAMETER_SEPARATOR } from \"../../constants/Constants\";\nimport { getSetting } from \"../../settings/Settings\";\n\nimport type { AttributeValue, MaybeAttributeValue } from \"../attributes/types\";\n\nexport class Parameter {\n [immerable] = true;\n\n private _prefix?: string | null | undefined;\n private _name: string;\n private _value?: MaybeAttributeValue;\n private _isModUIParameter = false;\n\n constructor(\n prefix?: string | null,\n name?: string,\n value?: MaybeAttributeValue,\n ) {\n this._prefix = prefix;\n this._name = name ?? \"\";\n if (value !== null) {\n this._value =\n typeof value === \"string\" ? decodeURIComponent(value) : value;\n }\n\n if (name) {\n this.setIsModUIParameter(name);\n }\n }\n\n /**\n * Getting prefix\n */\n get prefix() {\n return this._prefix;\n }\n\n /**\n * Getting name\n */\n get name() {\n return this._name;\n }\n\n /**\n * Getting value\n */\n get value() {\n return this._value;\n }\n\n static fromString(parameter: string) {\n if (parameter == null || parameter === \"\" || !parameter.includes(\"=\")) {\n return new Parameter();\n }\n\n // parameter has the structure prefix~name=value\n const param = parameter.split(\"=\");\n return Parameter.fromURLSearchParam(param[0], param[1]);\n }\n\n static fromURLSearchParam(key: string, value: string) {\n if (key.includes(PARAMETER_SEPARATOR)) {\n const prefix = key.substring(0, key.indexOf(\"~\"));\n const name = key.substring(key.indexOf(\"~\") + 1);\n\n return new Parameter(prefix, name, value);\n }\n\n return new Parameter(undefined, key, value);\n }\n\n /**\n * Convert parameter to string\n */\n toString(withPrefix = true) {\n if (!this.name) {\n return \"\";\n }\n\n const value = this.value == null ? \"\" : this.value;\n\n return withPrefix && this.prefix\n ? `${this.prefix}${PARAMETER_SEPARATOR}${this.name}=${value}`\n : `${this.name}=${value}`;\n }\n\n toQuerystring(withPrefix = true) {\n const value =\n this.value == null ? \"\" : this.paramValueToQuerystring(this.value);\n\n return withPrefix && this.prefix\n ? `${this.prefix}${PARAMETER_SEPARATOR}${this.name}=${value}`\n : `${this.name}=${value}`;\n }\n\n private paramValueToQuerystring(value: AttributeValue): string {\n if (\n typeof value === \"number\" ||\n typeof value === \"string\" ||\n typeof value === \"boolean\"\n ) {\n return encodeURIComponent(value);\n }\n\n if (Array.isArray(value)) {\n return value\n .filter((val) => val != null)\n .map((val) => this.paramValueToQuerystring(val))\n .join(\",\");\n }\n\n return JSON.stringify(value);\n }\n\n /**\n * Indicates if parameter is expected by the Be Informed modular UI\n */\n get isModUIParameter() {\n return this._isModUIParameter;\n }\n\n setIsModUIParameter(name: string) {\n const uiParameterSetting = getSetting(\"UI_PARAMETERS\", []);\n if (Array.isArray(uiParameterSetting)) {\n this._isModUIParameter = !uiParameterSetting.includes(name);\n }\n }\n}\n","import { BaseCollection } from \"../base/BaseCollection\";\nimport { Parameter } from \"./Parameter\";\n\nimport type { MaybeAttributeValue } from \"../attributes/types\";\n\nexport class ParameterCollection extends BaseCollection<Parameter> {\n static fromSearch(search: string | undefined) {\n const parameterCollection = new ParameterCollection();\n\n const params: URLSearchParams = new URLSearchParams(search);\n\n params.forEach((value, key) => {\n parameterCollection.add(Parameter.fromURLSearchParam(key, value));\n });\n\n return parameterCollection;\n }\n\n static fromUrl(url: string) {\n const parameterCollection = new ParameterCollection();\n\n if (url.includes(\"?\")) {\n url\n .split(\"?\")[1]\n .split(\"&\")\n .forEach((param) => {\n parameterCollection.add(Parameter.fromString(param));\n });\n }\n\n return parameterCollection;\n }\n\n /**\n * Get the parameters as a querystring, e.g. param1=value1&param2=value2, optionally with prefix\n */\n asQuerystring(withPrefix = false) {\n return this.collection\n .filter((param) => param.value != null && param.value !== \"\")\n .map((param) => param.toQuerystring(withPrefix))\n .join(\"&\");\n }\n\n /**\n * Retrieve a querystring that only contains parameter that can be send to the modular ui, parameters are filtered by prefix\n */\n asQueryStringForModularUI(prefix = \"\") {\n return this.collection\n .filter(\n (param) =>\n param.isModUIParameter &&\n (!prefix || !param.prefix || param.prefix === prefix) &&\n param.value != null,\n )\n .map((param) => param.toQuerystring(false))\n .join(\"&\");\n }\n\n /**\n * Remove a parameter from the parameter collection\n */\n removeParameter(\n name: string,\n prefix?: string | null,\n value?: MaybeAttributeValue,\n ) {\n if (value !== undefined) {\n // remove a specific value from the parameter\n const valueToRemove = value;\n\n this.collection = this.collection.map((param) => {\n if (param.prefix === prefix && param.name === name) {\n let newValue;\n if (typeof param.value === \"string\") {\n newValue = param.value\n .split(\",\")\n .filter((val) => val !== valueToRemove)\n .join(\",\");\n } else {\n newValue = param.value === value ? null : value;\n }\n return new Parameter(param.prefix, param.name, newValue);\n }\n\n return param;\n });\n } else {\n this.collection = this.collection.filter(\n (param) => param.prefix !== prefix || param.name !== name,\n );\n }\n\n return this;\n }\n}\n","import { immerable } from \"immer\";\n\nimport { HTTP_METHODS } from \"../../constants/Constants\";\nimport { getContentPath, getContextPathModularUI } from \"../../settings/Paths\";\nimport { Parameter } from \"../parameter/Parameter\";\nimport { ParameterCollection } from \"../parameter/ParameterCollection\";\n\nimport type { HistoryLocation } from \"../../types/types\";\nimport type { MaybeAttributeValue } from \"../attributes/types\";\nimport type { ModelOptions } from \"../types\";\n\nexport class Href<S = unknown> {\n [immerable] = true;\n\n private _origin = \"\";\n private _contextPath: string = getContextPathModularUI();\n private _path = \"\";\n private _hash = \"\";\n private _parameters: ParameterCollection = new ParameterCollection();\n private _resourcetype: string;\n private _method: HTTP_METHODS = HTTP_METHODS.GET;\n private _state?: S;\n private _referenceHash: number | undefined;\n\n constructor(\n href?: Href<S> | string | HistoryLocation,\n resourcetype?: string,\n modelOptions?: ModelOptions,\n ) {\n this._resourcetype = resourcetype ?? \"\";\n\n if (typeof href === \"string\") {\n this.initializeFromString(href);\n } else if (href instanceof Href) {\n this.initializeFromHref(href);\n } else if (href) {\n this.initializeFromLocation(href);\n }\n\n if (typeof modelOptions?.origin === \"string\") {\n this.origin = modelOptions.origin;\n }\n\n if (typeof modelOptions?.contextPath === \"string\") {\n this.contextPath = modelOptions.contextPath;\n }\n }\n\n private initializeFromString(href: string) {\n this._path = Href.getPathFromString(href);\n this._parameters = ParameterCollection.fromUrl(href);\n this._hash = Href.getHashFromString(href);\n }\n\n private initializeFromHref(href: Href<S>) {\n this._origin = href.origin;\n this._contextPath = href.contextPath;\n this._path = href.path;\n this._parameters = href.parameters;\n this._hash = href.hash;\n this._state = href.state;\n }\n\n private initializeFromLocation(location: HistoryLocation) {\n this._path = location.pathname ?? \"\";\n this._parameters = ParameterCollection.fromSearch(location.search);\n this._hash = location.hash ?? \"\";\n\n this.initializeStateFromLocation(location);\n }\n\n private initializeStateFromLocation(location: HistoryLocation) {\n if (location.state instanceof Object) {\n this._state = location.state as S;\n this._origin =\n \"origin\" in location.state && typeof location.state.origin === \"string\"\n ? location.state.origin\n : \"\";\n this._contextPath =\n \"contextPath\" in location.state &&\n typeof location.state.contextPath === \"string\"\n ? location.state.contextPath\n : \"\";\n }\n }\n\n get key() {\n return Math.random().toString(36).substring(2, 10);\n }\n\n get origin() {\n return this._origin;\n }\n\n set origin(origin: string) {\n this._origin = origin;\n }\n\n get contextPath() {\n return this._contextPath;\n }\n\n set contextPath(contextPath: string) {\n this._contextPath = contextPath;\n }\n\n get path() {\n return this._path || \"\";\n }\n\n /**\n * Set the path of the Href, the part before the querystring question mark\n */\n set path(path: string) {\n this._path = path;\n }\n\n get parameters() {\n return this._parameters;\n }\n\n set parameters(parameters) {\n this._parameters = parameters;\n }\n\n get hash() {\n return this._hash;\n }\n\n set hash(hash) {\n this._hash = hash;\n }\n\n get state() {\n return this._state;\n }\n\n set state(state) {\n this._state = state;\n }\n\n setState(state: S): Href {\n this.state = state;\n return this;\n }\n\n /**\n * Get request method\n */\n get method(): HTTP_METHODS {\n return this._method;\n }\n\n /**\n * Set request method\n */\n set method(method: HTTP_METHODS) {\n this._method = method || HTTP_METHODS.GET;\n }\n\n /**\n * Set resourctype\n */\n set resourcetype(resourcetype: string) {\n this._resourcetype = resourcetype;\n }\n\n /**\n * Retrieve resourceType\n */\n get resourcetype() {\n return this._resourcetype;\n }\n\n get isChangePassword() {\n return this.path.includes(\"/change-password\");\n }\n\n /**\n * Check if url is relative (not checking for absolute urls with same domain)\n */\n get isExternal() {\n return Href.checkAbsoluteUrl(this.path);\n }\n\n /**\n * Add a querystring parameter to the parameter collection of this Href, skips parameters that have a value of null\n */\n addParameter(\n name: string,\n value?: MaybeAttributeValue,\n prefix?: string | null,\n ): Href {\n if (value !== null) {\n this.parameters.removeParameter(name, prefix);\n this.parameters.add(new Parameter(prefix, name, value));\n }\n\n return this;\n }\n\n /**\n * Adds or overwrites a parameter when it exists and value is not null.\n * Removes the parameter when the value is null\n */\n setParameter(\n name: string,\n value?: MaybeAttributeValue,\n prefix?: string | null,\n ): Href {\n if (value != null) {\n this.addParameter(name, value, prefix);\n } else {\n this.parameters.removeParameter(name, prefix);\n }\n return this;\n }\n\n removeParameter(\n name: string,\n prefix?: string | null,\n value?: MaybeAttributeValue,\n ): Href {\n this.parameters.removeParameter(name, prefix, value);\n return this;\n }\n\n /**\n * Retrieve a parameter by it's name and (optionally) prefix\n */\n getParameter(name: string, prefix?: string | null) {\n return this.parameters.find(\n (param) => param.prefix === prefix && param.name === name,\n );\n }\n\n hasParameter(name: string, prefix?: string) {\n return this.getParameter(name, prefix) !== undefined;\n }\n\n /**\n * Get the parameters as a querystring, e.g. param1=value1&param2=value2, optionally with prefix\n */\n getQuerystring(withPrefix = false) {\n return this.parameters.asQuerystring(withPrefix);\n }\n\n /**\n * Retrieve a querystring that only contains parameter that can be send to the modular ui, parameters are filtered by prefix\n */\n getQuerystringForModularUI(prefix = \"\") {\n return this.parameters.asQueryStringForModularUI(prefix);\n }\n\n /**\n * Retrieve all parameters from the parameter collection in a querystring style name1=value1&name2=value2, without the prefix\n */\n get querystring(): string {\n return this.parameters.asQuerystring(false);\n }\n\n /**\n * Retrieve the path combined with the base path (context-path) of the application, e.g. /BeInformed\n */\n get absolutepath(): string {\n if (this.isExternal) {\n return this.path;\n }\n return this.origin + this.contextPath + this.path;\n }\n\n /**\n * Retrieves the combination of the path and the querystring\n */\n get href() {\n return this.querystring.length > 0\n ? [this.path, this.querystring].join(\"?\")\n : this.path;\n }\n\n /**\n * Getting the URL including the base path, querystring is prefixed\n */\n get absolutehref() {\n const querystring = this.getQuerystring(false);\n\n return querystring.length > 0\n ? [this.absolutepath, querystring].join(\"?\")\n : this.absolutepath;\n }\n\n /**\n * Getting the URL including the base path, the querystring is prefixed\n */\n get absolutehrefPrefixedQuerystring(): string {\n const querystring = this.getQuerystring(true);\n\n return querystring.length > 0\n ? [this.absolutepath, querystring].join(\"?\")\n : this.absolutepath;\n }\n\n /**\n * Checks if the URL starts within the given href\n */\n startsWith(href: Href | string) {\n const thisPath = `${this.path}/`;\n const otherPath = href instanceof Href ? `${href.path}/` : href;\n\n return thisPath.startsWith(otherPath);\n }\n\n /**\n * Checks if the given Href equals this Href\n */\n equals(href: Href | string | undefined) {\n if (href instanceof Href) {\n return this.path === href.path;\n }\n\n return this.path === href;\n }\n\n equalsWithParameters(other: Href | string | null) {\n if (other == null) {\n return false;\n }\n\n const href = other instanceof Href ? other : new Href(other);\n\n if (!this.equals(href)) {\n return false;\n }\n\n if (this.parameters.length !== href.parameters.length) {\n return false;\n }\n\n if (this.parameters.length === 0 && href.parameters.length === 0) {\n return true;\n }\n\n const thisParams = this.parameters.map((param) => param.toString());\n\n return href.parameters.every((param) => {\n return thisParams.includes(param.toString());\n });\n }\n\n /**\n * Indicates if the link is a contentconfiguration link\n */\n get isContent() {\n return this.absolutepath.startsWith(getContentPath());\n }\n\n getReferenceHash() {\n return this._referenceHash;\n }\n\n setReferenceHash(referenceHash: number | undefined) {\n this._referenceHash = referenceHash;\n }\n\n /**\n * Returns a complete url from the Href\n */\n toString(): string {\n return this.href;\n }\n\n toLocation(): HistoryLocation {\n const state = this.state instanceof Object ? this.state : {};\n\n return {\n key: this.key,\n pathname: this.path,\n search: this.querystring.length > 0 ? `?${this.querystring}` : \"\",\n hash: this.hash.length > 0 ? `#${this.hash}` : \"\",\n state: {\n origin: this.origin,\n contextPath: this.contextPath,\n ...state,\n },\n };\n }\n\n /**\n * Retrieve the relative path part of a href string, e.g. https://www.beinformed.com/BeInformed/tab/view?q=url => /tab/view\n */\n static getPathFromString(href: string) {\n return href.split(\"#\")[0].split(\"?\")[0];\n }\n\n static getHashFromString(href: string) {\n return href.includes(\"#\") ? href.substring(href.indexOf(\"#\") + 1) : \"\";\n }\n\n /**\n * check if the path is referencing a camel route\n */\n static isCamelRoute(path: string) {\n return (\n path.startsWith(\"/restServices\") && !path.startsWith(\"/restServices/ui\")\n );\n }\n\n static checkAbsoluteUrl(href: string) {\n const checkAbsolute = new RegExp(\"^(?:[a-z]+:)?//\", \"i\");\n return checkAbsolute.test(href);\n }\n}\n","import hash from \"hash-it\";\n\nimport type { SectionFragment } from \"../../models/concepts/types\";\nimport type { Href } from \"../../models/href/Href\";\n\n/**\n * https://werxltd.com/wp/2010/05/13/javascript-implementation-of-javas-string-hashcode-method/\n */\nexport const createHash = (str: string) => {\n return hash(str);\n};\n\nexport const createHashFromHref = (\n href: Href | undefined,\n fragment?: SectionFragment,\n) => {\n if (href == null) {\n return 0;\n }\n\n const hrefString = href.hash\n ? [href.toString(), href.hash].join(\"#\")\n : href.toString();\n\n if (fragment) {\n return hash({ hrefString, fragment });\n }\n\n return hash(hrefString);\n};\n","import type { ErrorMessage, TextWithPlaceholders } from \"../../types/types\";\n\n/**\n * Handles text that is in the ApplicationMessage form\n */\nexport const retrieveText = (\n text: string | undefined | ErrorMessage | TextWithPlaceholders,\n) => {\n if (typeof text === \"string\") {\n return text;\n }\n\n if (\n typeof text === \"object\" &&\n \"message\" in text &&\n typeof text.message === \"string\"\n ) {\n return text.message;\n }\n\n return;\n};\n","// @see: https://docs.oracle.com/javase/tutorial/i18n/format/decimalFormat.html\nexport class DecimalFormat {\n private _prefix = \"\";\n private _suffix = \"\";\n\n // Grouping size\n private _comma = 0;\n // Minimum integer digits to be displayed\n private _minInt = 1;\n\n // Minimum fractional digits to be displayed\n private _minFrac = 0;\n // Maximum fractional digits to be displayed\n private _maxFrac = 0;\n\n private _isPercentage = false;\n\n constructor(format: string) {\n this.setAffix(format);\n this.setFractionLengths(format);\n this.setGroupLength(format);\n this.setMinLength(format);\n\n this.setPercentage();\n }\n\n get prefix(): string {\n return this._prefix;\n }\n\n get suffix(): string {\n return this._suffix;\n }\n\n get comma(): number {\n return this._comma;\n }\n\n get minInt(): number {\n return this._minInt;\n }\n\n get minFrac(): number {\n return this._minFrac;\n }\n\n get maxFrac(): number {\n return this._maxFrac;\n }\n\n get isPercentage(): boolean {\n return this._isPercentage;\n }\n\n setAffix(format: string) {\n const beforeDigit = format.includes(\"#\")\n ? format.substring(0, format.indexOf(\"#\"))\n : format;\n\n this._prefix = beforeDigit.includes(\"0\")\n ? beforeDigit.substring(0, beforeDigit.indexOf(\"0\"))\n : beforeDigit;\n this._suffix = format\n .substring(this._prefix.length)\n .replace(/[#,.0]/gu, \"\");\n }\n\n setFractionLengths(format: string) {\n const numberStr = format.replace(/[^#,.0]/gu, \"\");\n if (numberStr.includes(\".\")) {\n const fracStr = numberStr.substring(numberStr.indexOf(\".\") + 1);\n\n const maxFrac = fracStr.replace(/,|\\.+/g, \"\");\n this._maxFrac = maxFrac.length;\n\n // replace all but zeros\n const minFrac = maxFrac.replace(/[^0]/gu, \"\");\n this._minFrac = minFrac.length;\n }\n }\n\n setGroupLength(format: string) {\n const numberStr = format.replace(/[^#,.0]/gu, \"\");\n const intStr = numberStr.includes(\".\")\n ? numberStr.substring(0, numberStr.indexOf(\".\"))\n : numberStr;\n\n if (intStr.includes(\",\")) {\n this._comma = intStr.length - 1 - intStr.lastIndexOf(\",\");\n }\n }\n\n setMinLength(format: string) {\n const intFormatStr = format.includes(\".\")\n ? format.substring(0, format.indexOf(\".\"))\n : format;\n const intStr = intFormatStr.replace(/[^0]/gu, \"\");\n\n this._minInt = intStr.length > 1 ? intStr.length : 1;\n }\n\n setPercentage() {\n this._isPercentage = this.suffix.charAt(0) === \"%\";\n }\n\n /**\n * Solves problem where big numbers loose the precision:\n * e.g. Number(23423423423342234.34) => 23423423423342236\n */\n static getNumericString(stringNumber: string): string {\n const number = Number(stringNumber);\n const string = String(number);\n\n if (!string.includes(\".\") && stringNumber.includes(\".\")) {\n // check if original string has all zeros after dot or not\n const precision = stringNumber.substring(stringNumber.indexOf(\".\") + 1);\n if (precision.replace(/0/gu, \"\").length > 0) {\n return stringNumber;\n }\n\n return string;\n }\n\n return stringNumber;\n }\n\n /**\n * Converts formatted value back to non-formatted value\n * e.g. $1,223.06 --> 1223.06\n */\n formatBack(formattedNumber: string): string {\n const stringNumber = String(formattedNumber);\n\n if (!stringNumber) {\n return \"\";\n }\n\n if (!isNaN(Number(stringNumber))) {\n return DecimalFormat.getNumericString(stringNumber);\n }\n\n let tempNumber = formattedNumber;\n\n let negative = false;\n if (formattedNumber.charAt(0) === \"-\") {\n tempNumber = formattedNumber.substr(1);\n negative = true;\n }\n\n const hasPrefix = formattedNumber.startsWith(this.prefix);\n\n const suffixIndex =\n this.suffix === \"\"\n ? formattedNumber.length\n : formattedNumber.indexOf(this.suffix, this.prefix.length + 1);\n\n if (hasPrefix && suffixIndex > 0) {\n tempNumber = tempNumber.substr(0, suffixIndex);\n tempNumber = tempNumber.substr(this.prefix.length);\n tempNumber = tempNumber.replace(/,/gu, \"\");\n\n if (negative) {\n tempNumber = `-${tempNumber}`;\n }\n\n if (!isNaN(Number(tempNumber))) {\n return DecimalFormat.getNumericString(tempNumber);\n }\n }\n\n return tempNumber;\n }\n\n static scientificNumber(stringNumber: string): string {\n if (stringNumber.includes(\"e\")) {\n const number = Number(stringNumber);\n if (number === Infinity || number === -Infinity) {\n return stringNumber;\n }\n\n return String(number);\n }\n\n return stringNumber;\n }\n\n getFracAsNumber(fracStr: string): string {\n const number = Number(`0.${fracStr}`);\n const DECIMAL_RADIX = 10;\n\n return this.maxFrac === 0\n ? Math.round(number).toString(DECIMAL_RADIX)\n : number.toFixed(this.maxFrac);\n }\n\n getRoundedFrac(fracStr: string): string {\n const num = this.getFracAsNumber(fracStr);\n\n // toFixed method has bugs on IE (0.7 --> 0)\n return num.substr(2);\n }\n\n static getFraction(number: string): string {\n let fracStr = number.includes(\".\")\n ? number.substring(number.indexOf(\".\") + 1)\n : \"\";\n\n fracStr = fracStr.replace(/\\./, \"\");\n\n return fracStr;\n }\n\n getFracCorrectLength(frac: string): string {\n let fracStr = frac;\n\n if (fracStr.length > this.maxFrac) {\n fracStr = this.getRoundedFrac(fracStr);\n }\n\n for (let i = fracStr.length; i < this.minFrac; i++) {\n // if minFrac=4 then 1.12 --> 1.1200\n fracStr = `${fracStr}0`;\n }\n\n while (\n fracStr.length > this.minFrac &&\n fracStr.charAt(fracStr.length - 1) === \"0\"\n ) {\n // if minInt=4 then 00034 --> 0034)\n fracStr = fracStr.substring(0, fracStr.length - 1);\n }\n\n return fracStr;\n }\n\n getInteger(number: string): string {\n let intStr = number.includes(\".\")\n ? number.substring(0, number.indexOf(\".\"))\n : number;\n\n let doCarry = Number(this.getFracAsNumber(number)) > 1;\n let i = intStr.length - 1;\n\n while (doCarry) {\n if (i === -1) {\n intStr = `1${intStr}`;\n break;\n }\n\n let x = intStr.charAt(i);\n if (x === \"9\") {\n x = \"0\";\n } else {\n x = `${x + 1}`;\n doCarry = false;\n }\n\n intStr =\n intStr.substring(0, i) + x + intStr.substring(i + 1, intStr.length);\n\n i -= 1;\n }\n\n for (let j = intStr.length; j < this.minInt; j++) {\n // if minInt=4 then 034 --> 0034\n intStr = `0${intStr}`;\n }\n\n while (intStr.length > this.minInt && intStr.charAt(0) === \"0\") {\n // if minInt=4 then 00034 --> 0034)\n intStr = intStr.substring(1);\n }\n\n return intStr;\n }\n\n addGrouping(intStr: string): string {\n let groupedIntStr = intStr;\n\n let j = 0;\n for (let i = groupedIntStr.length; i > 0; i--) {\n // add commas\n if (j !== 0 && j % this.comma === 0) {\n groupedIntStr = `${groupedIntStr.substring(\n 0,\n i,\n )},${groupedIntStr.substring(i)}`;\n j = 0;\n }\n\n j += 1;\n }\n\n return groupedIntStr;\n }\n\n getFormattedValue(\n intStr: string,\n fracStr: string,\n isNegative: boolean,\n ): string {\n let formattedValue;\n if (fracStr.length > 0)\n formattedValue = `${this.prefix + intStr}.${fracStr}${this.suffix}`;\n else formattedValue = this.prefix + intStr + this.suffix;\n\n if (isNegative) {\n formattedValue = `-${formattedValue}`;\n }\n\n return formattedValue;\n }\n\n /**\n * Formats given value, using the pattern\n * e.g. $#,###.00: 1223.06 --> $1,223.06\n */\n format(stringNumber = \"\"): string {\n if (stringNumber === null) {\n return \"\";\n }\n\n let formattedNumber = this.formatBack(stringNumber).toLowerCase();\n\n if (isNaN(Number(formattedNumber)) || formattedNumber.length === 0) {\n return stringNumber;\n }\n\n formattedNumber = DecimalFormat.scientificNumber(formattedNumber);\n if (formattedNumber.includes(\"e\")) {\n return formattedNumber;\n }\n\n const isNegative = formattedNumber.charAt(0) === \"-\";\n if (isNegative || formattedNumber.charAt(0) === \"+\") {\n formattedNumber = formattedNumber.substring(1);\n }\n\n let fracStr = DecimalFormat.getFraction(formattedNumber);\n let intStr = this.getInteger(formattedNumber);\n if (this.isPercentage) {\n // Add zeros behind fraction to make sure we have at least two characters and take first two character:\n // 1 --> 100 --> 10\n const addZeroToFrac = `${fracStr}00`.substr(0, 2);\n // Add zeros in front of frac and get last two characters\n const lastTwoFrac = `00${addZeroToFrac}`.substr(-2);\n\n intStr = `${intStr}${lastTwoFrac}`;\n fracStr = fracStr.substr(2);\n }\n\n fracStr = this.getFracCorrectLength(fracStr);\n\n intStr = this.addGrouping(intStr);\n\n return this.getFormattedValue(intStr, fracStr, isNegative);\n }\n}\n","import big from \"big.js\";\n\nimport { IllegalArgumentException } from \"../../exceptions/IllegalArgumentException\";\nimport { DecimalFormat } from \"./DecimalFormat\";\n\nimport type { MaybeAttributeValue } from \"../../models/attributes/types\";\n\nexport class NumberUtil {\n private static removeGroupingSeparator = (\n input: string | number,\n groupingSeparator?: string,\n ) => {\n if (typeof input === \"number\") {\n return input;\n }\n\n if (groupingSeparator == null) {\n return input;\n }\n\n const escapedGroupingSeparator = groupingSeparator.replace(\n /[$()*+.?[\\\\\\]^{|}]/g,\n \"\\\\$&\",\n );\n\n return input.replace(new RegExp(escapedGroupingSeparator, \"g\"), \"\");\n };\n\n private static updateDecimalSeparator = (\n input: string | number,\n decimalSeparator?: string,\n ) => {\n if (typeof input === \"number\") {\n return input;\n }\n\n if (decimalSeparator == null || decimalSeparator === \"\") {\n return input;\n }\n\n return input.replace(decimalSeparator, \".\");\n };\n\n /**\n * Parses input into a number, removes the grouping separator from the input and\n * replaces the decimal separator with a dot to make it a JavaScript parseable number\n */\n static parseToNumber = (\n input?: MaybeAttributeValue,\n groupingSeparator = \",\",\n decimalSeparator = \".\",\n ): number => {\n if (\n !(typeof input === \"number\" || typeof input === \"string\") ||\n input === \"\"\n ) {\n return NaN;\n }\n\n const inputNoGrouping = this.removeGroupingSeparator(\n input,\n groupingSeparator,\n );\n\n const inputCorrectDecimalSeparator = this.updateDecimalSeparator(\n inputNoGrouping,\n decimalSeparator,\n );\n\n return Number(inputCorrectDecimalSeparator);\n };\n\n /**\n * parses Numbers To String\n */\n static parseNumberToString = (\n input?: string | number | null | undefined,\n groupingSeparator = \",\",\n decimalSeparator = \".\",\n ): string => {\n if (input == null || input === \"\") {\n return \"NaN\";\n }\n\n const inputNoGrouping = this.removeGroupingSeparator(\n input,\n groupingSeparator,\n );\n\n const inputCorrectDecimalSeparator = this.updateDecimalSeparator(\n inputNoGrouping,\n decimalSeparator,\n );\n\n try {\n return big(inputCorrectDecimalSeparator).toFixed();\n } catch (_error) {\n return \"NaN\";\n }\n };\n\n private static updateGroupingSeparator(\n input: string,\n groupingSeparator: string,\n ) {\n if (groupingSeparator == null) {\n return input;\n }\n\n return input.replace(/,/g, groupingSeparator);\n }\n\n static formatNumber(\n value: number | string | null | undefined,\n format: string | undefined = \"#\",\n groupingSeparator = \",\",\n decimalSeparator = \".\",\n ) {\n if (value == null) {\n return \"\";\n }\n\n const numberValue =\n typeof value === \"number\"\n ? value\n : this.parseToNumber(value, groupingSeparator, decimalSeparator);\n\n if (typeof numberValue !== \"number\") {\n throw new IllegalArgumentException(\n `Not a valid number: ${value} for formatValue`,\n );\n }\n\n const stringValue = this.parseNumberToString(numberValue);\n\n if (format != null) {\n const formattedValue = new DecimalFormat(format).format(stringValue);\n\n const [integer, decimal] = formattedValue.split(\".\");\n\n const integerPart = this.updateGroupingSeparator(\n integer,\n groupingSeparator,\n );\n\n if (decimal) {\n return `${integerPart}${decimalSeparator}${decimal}`;\n }\n\n return integerPart;\n }\n\n return stringValue;\n }\n\n static isSameOrBefore(startValue: number, endValue: number) {\n return startValue <= endValue;\n }\n\n static isBefore(startValue: number, endValue: number) {\n return startValue < endValue;\n }\n}\n"],"mappings":"0NAAA,OAAS,aAAAA,MAAiB,QAEnB,IAAeC,EAAf,MAAeC,CAAkB,CACtC,CAACF,CAAS,EAAI,GAEN,YAER,YAAYG,EAAkB,CAAC,EAAG,CAChC,KAAK,YAAcA,CACrB,CAEA,IAAI,YAAa,CACf,OAAO,KAAK,WACd,CAEA,IAAI,WAAWA,EAAiB,CAC9B,KAAK,YAAcA,CACrB,CAKA,IAAI,KAAM,CACR,OAAO,KAAK,UACd,CAKA,IAAIC,EAAoC,CAClCA,aAAiBF,EACnB,KAAK,WAAa,CAAC,GAAG,KAAK,WAAY,GAAGE,EAAM,GAAG,EAC1C,MAAM,QAAQA,CAAK,EAC5B,KAAK,WAAa,CAAC,GAAG,KAAK,WAAY,GAAGA,CAAK,EAE/C,KAAK,WAAa,CAAC,GAAG,KAAK,WAAYA,CAAK,CAEhD,CAKA,cAAcC,EAAmB,CAC3BA,EAAY,KACd,KAAK,WAAa,CAChB,GAAG,KAAK,WAAW,MAAM,EAAGA,CAAS,EACrC,GAAG,KAAK,WAAW,MAAMA,EAAY,CAAC,CACxC,EAEJ,CAKA,UAAW,CACT,OAAO,KAAK,OAAS,CACvB,CAKA,SAAU,CACR,MAAO,CAAC,KAAK,SAAS,CACxB,CAKA,IAAI,QAAS,CACX,OAAO,KAAK,WAAW,MACzB,CAKA,IAAI,MAAO,CACT,OAAO,KAAK,MACd,CAKA,IAAI,OAAQ,CACV,OAAO,KAAK,WAAW,CAAC,CAC1B,CAKA,IAAI,MAAO,CACT,OA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CAAW,EAE7D,CAACG,EAASC,CAAO,EAAIH,EAAe,MAAM,GAAG,EAE7CI,EAAc,KAAK,wBACvBF,EACAb,CACF,EAEA,OAAIc,EACK,GAAGC,CAAW,GAAGb,CAAgB,GAAGY,CAAO,GAG7CC,CACT,CAEA,OAAOL,CACT,CAEA,OAAO,eAAeM,EAAoBC,EAAkB,CAC1D,OAAOD,GAAcC,CACvB,CAEA,OAAO,SAASD,EAAoBC,EAAkB,CACpD,OAAOD,EAAaC,CACtB,CACF","names":["immerable","BaseCollection","_BaseCollection","collection","items","itemIndex","index","callbackfn","thisArg","compareFn","Cookies","getCookie","name","Cookies","setCookie","value","options","attributes","getContextPathServer","clearCookie","tz","add","endOfMonth","format","getDay","getHours","getMinutes","getWeek","isAfter","isBefore","isSameDay","isValid","enGB","nl","parse","set","startOfMonth","startOfWeek","sub","soft","BaseDateTimeUtil","isoFormat","doOffsets","isIncludeTimeOffsetInDateTimes","weekStartsOn","getNumberSetting","DEFAULT_WEEK_STARTS_ON","firstWeekContainsDate","DEFAULT_FIRST_WEEK_CONTAINS_DATE","DATETIME_OFFSET_FORMAT","javaFormat","javaToUTS35Map","uts35Format","sortedKeys","a","b","javaToken","uts35Token","regex","defaultLocale","getEnabledLocales","getCookie","nl","enGB","date","inputFormat","parse","targetFormat","parsedDate","isValid","format","sourceFormat","formattedValue","isBefore","isAfter","inputDate","afterISODate","beforeISODate","compareDate","isSameDay","weekDay","getDay","dateTime","x","newDate","add","time","calculationFn","property","value","amount","sub","method","options","startOfMonth","endOfMonth","startOfWeek","getHours","getMinutes","getWeek","set","year","month","day","hour","minute","second","millisecond","hours","minutes","seconds","milliseconds","timeZone","IS_GRAALJS","tz","dateOffset","offsets","info","sign","absOffset","offsetString","timezone","soft","daylight","standard","DateUtil","ISO_DATE_FORMAT","DateTimeUtil","ISO_DATETIME_FORMAT","TimeUtil","ISO_TIME_FORMAT","TimestampUtil","ISO_TIMESTAMP_FORMAT","immerable","Parameter","_Parameter","immerable","prefix","name","value","parameter","param","key","PARAMETER_SEPARATOR","withPrefix","val","uiParameterSetting","getSetting","ParameterCollection","_ParameterCollection","BaseCollection","search","parameterCollection","value","key","Parameter","url","param","withPrefix","prefix","name","valueToRemove","newValue","val","immerable","Href","_Href","immerable","getContextPathModularUI","ParameterCollection","href","resourcetype","modelOptions","location","origin","contextPath","path","parameters","hash","state","method","name","value","prefix","Parameter","param","withPrefix","querystring","thisPath","otherPath","other","thisParams","getContentPath","referenceHash","hash","createHash","str","createHashFromHref","href","fragment","hrefString","retrieveText","text","DecimalFormat","_DecimalFormat","format","beforeDigit","numberStr","maxFrac","minFrac","intStr","stringNumber","number","string","formattedNumber","tempNumber","negative","hasPrefix","suffixIndex","fracStr","frac","i","doCarry","x","j","groupedIntStr","isNegative","formattedValue","lastTwoFrac","big","NumberUtil","input","groupingSeparator","escapedGroupingSeparator","decimalSeparator","inputNoGrouping","inputCorrectDecimalSeparator","big","value","format","numberValue","IllegalArgumentException","stringValue","formattedValue","DecimalFormat","integer","decimal","integerPart","startValue","endValue"]}
@@ -1,2 +0,0 @@
1
- import{l as i}from"./chunk-BODVDNNA.js";import{a as c}from"./chunk-VGAPPKHA.js";import{x as f}from"./chunk-LYBG43T6.js";import{f as x}from"./chunk-WVQSFYWD.js";var A=t=>{let r=new i(t).absolutehref,e=new XMLHttpRequest;return e.open("HEAD",r,!1),e.setRequestHeader("Accept","application/json"),e.setRequestHeader("Content-Type","application/json"),e.setRequestHeader("X-Requested-With","XMLHttpRequest"),e.send(),e.status!==404},T=t=>{let r=new i(t).absolutehref,e=new XMLHttpRequest;e.open("HEAD",r,!1),e.setRequestHeader("Accept","application/json"),e.setRequestHeader("Content-Type","application/json"),e.setRequestHeader("X-Requested-With","XMLHttpRequest"),e.send();let s=e.responseURL??"";return e.status===400&&s.endsWith("/secureLogin")};var u=t=>{if(t instanceof i)return{path:t.path,querystring:t.querystring,hash:t.hash};let r=t,e,s;if(t.includes("#")){let o=t.split("#");r=o[0],e=o[1]}if(t.includes("?")){let o=r.split("?");r=o[0],s=o[1]}return{path:r,querystring:s,hash:e}},l=(t,r)=>{if(!Array.isArray(r))return new i(t);let e=u(t),s=e.path;if(e.querystring){let o=new URLSearchParams(e.querystring),n=Array.from(o.keys());for(let p of n)r.includes(p)||o.delete(p);s=s+"?"+o.toString()}return e.hash&&(s=s+"#"+e.hash),t instanceof i?new i(s,t.resourcetype,{origin:t.origin,contextPath:t.contextPath}):new i(s)},L=(t,r,e,s,o)=>{let n=r.toString();if(n.startsWith(`/${t}/`)||(n=`/${t}/${n}`),n=n.replace(/\/\//g,"/"),s?.search&&!n.includes("?")){let a=s.search.startsWith("?")?s.search.substring(1):s.search;n=`${n}?${a}`}let p=r instanceof i?l(new i(n,r.resourcetype,{origin:r.origin,contextPath:r.contextPath}),o):l(n,o);return e?p.setParameter("entryDate",e):p.removeParameter("entryDate"),p};var b=()=>{let t=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,r=>{let e=(t+Math.random()*16)%16|0;return t=Math.floor(t/16),(r==="x"?e:e&3|8).toString(16)})};var M=(t,r=f(),e="")=>t.startsWith(e+r)?t:t.startsWith(x)?`${e}${r}${t}`:`${e}${r}${x}${t}`;import{encode as m}from"html-entities";var g=t=>m(t,{mode:"nonAsciiPrintableOnly",level:"xml"}),j=(t,r={allowedTags:["p","br","b","i","u","strike"]})=>{if(typeof t!="string")throw new c("sanitizeHTML method expects a string");let o=g(t).replace(/<(\w+)(.|[\r\n])*?>/gi,"<$1>").replace(/<br\s*>/gi,"<br />"),p=`<(?!\\/?(${Array.isArray(r.allowedTags)?r.allowedTags.join("|"):""})(>|\\s\\/))[^<]+?>`,a=new RegExp(p,"gi");return o.replace(a,"")};export{A as a,T as b,u as c,l as d,L as e,b as f,M as g,j as h};
2
- //# sourceMappingURL=chunk-EP2OYSVS.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/utils/helpers/checkResource.ts","../src/utils/helpers/createHref.ts","../src/utils/helpers/createUUID.ts","../src/utils/helpers/repositoryResource.ts","../src/utils/helpers/sanitizeHtml.ts"],"sourcesContent":["import { Href } from \"../../models/href/Href\";\n\n/**\n * Checks if a given url to a modular ui resource exists using a HEAD request to the resource (synchronous)\n * When the resource returns a 404, the resource does not exists and the method returns false\n */\nexport const resourceExists = (url: string | Href) => {\n const fullUrl = new Href(url).absolutehref;\n\n const xhr = new XMLHttpRequest();\n xhr.open(\"HEAD\", fullUrl, false);\n xhr.setRequestHeader(\"Accept\", \"application/json\");\n xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n xhr.setRequestHeader(\"X-Requested-With\", \"XMLHttpRequest\");\n\n xhr.send();\n\n return xhr.status !== 404;\n};\n\n/**\n * Indicates if a request to the given url resuls in a redirect to /secureRedirect\n */\nexport const resourceRedirectsToSecureLogin = (url: string | Href) => {\n const fullUrl = new Href(url).absolutehref;\n\n const xhr = new XMLHttpRequest();\n xhr.open(\"HEAD\", fullUrl, false);\n xhr.setRequestHeader(\"Accept\", \"application/json\");\n xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n xhr.setRequestHeader(\"X-Requested-With\", \"XMLHttpRequest\");\n xhr.send();\n\n const responseURL = xhr.responseURL ?? \"\";\n\n return xhr.status === 400 && responseURL.endsWith(\"/secureLogin\");\n};\n","import { Href } from \"../../models/href/Href\";\n\nimport type { HistoryLocation, ISO_DATE } from \"../../types/types\";\n\nexport const parseUrl = (\n href: string | Href,\n): {\n path: string;\n querystring: undefined | string;\n hash: undefined | string;\n} => {\n if (href instanceof Href) {\n return {\n path: href.path,\n querystring: href.querystring,\n hash: href.hash,\n };\n }\n\n let path = href;\n let hash;\n let querystring;\n if (href.includes(\"#\")) {\n const hashSplit = href.split(\"#\");\n path = hashSplit[0];\n hash = hashSplit[1];\n }\n if (href.includes(\"?\")) {\n const qsSplit = path.split(\"?\");\n path = qsSplit[0];\n querystring = qsSplit[1];\n }\n return {\n path,\n querystring,\n hash,\n };\n};\n\nexport const filterParameters = (\n href: string | Href,\n allowedParameters?: string[],\n) => {\n if (!Array.isArray(allowedParameters)) {\n return new Href(href);\n }\n\n const url = parseUrl(href);\n let filteredUrl = url.path;\n if (url.querystring) {\n const searchParams = new URLSearchParams(url.querystring);\n const params = Array.from(searchParams.keys());\n for (const param of params) {\n if (!allowedParameters.includes(param)) {\n searchParams.delete(param);\n }\n }\n filteredUrl = filteredUrl + \"?\" + searchParams.toString();\n }\n if (url.hash) {\n filteredUrl = filteredUrl + \"#\" + url.hash;\n }\n\n if (href instanceof Href) {\n return new Href(filteredUrl, href.resourcetype, {\n origin: href.origin,\n contextPath: href.contextPath,\n });\n }\n\n return new Href(filteredUrl);\n};\n\nexport const createHref = (\n context: string,\n dynamicPart: string | Href,\n entryDate?: ISO_DATE,\n location?: HistoryLocation,\n allowedParameters?: string[],\n): Href => {\n let href = dynamicPart.toString();\n\n if (!href.startsWith(`/${context}/`)) {\n href = `/${context}/${href}`;\n }\n\n href = href.replace(/\\/\\//g, \"/\");\n\n if (location?.search && !href.includes(\"?\")) {\n const search = location.search.startsWith(\"?\")\n ? location.search.substring(1)\n : location.search;\n href = `${href}?${search}`;\n }\n\n const finalHref =\n dynamicPart instanceof Href\n ? filterParameters(\n new Href(href, dynamicPart.resourcetype, {\n origin: dynamicPart.origin,\n contextPath: dynamicPart.contextPath,\n }),\n allowedParameters,\n )\n : filterParameters(href, allowedParameters);\n\n if (entryDate) {\n finalHref.setParameter(\"entryDate\", entryDate);\n } else {\n finalHref.removeParameter(\"entryDate\");\n }\n\n return finalHref;\n};\n","export const createUUID = () => {\n let d = new Date().getTime();\n return \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g, (c) => {\n const r = (d + Math.random() * 16) % 16 | 0;\n d = Math.floor(d / 16);\n return (c === \"x\" ? r : (r & 0x3) | 0x8).toString(16);\n });\n};\n","import { RESOURCE_PATH } from \"../../constants/Paths\";\nimport { getContextPathServer } from \"../../settings/Paths\";\n\n/**\n * Creates an url to a resource in the Be Informed repository\n * Only possible when serving using the UI Servlet of Be Informed\n */\nexport const getRepositoryResourceUrl = (\n resourceUrl: string,\n contextPath: string = getContextPathServer(),\n origin = \"\",\n): string => {\n if (resourceUrl.startsWith(origin + contextPath)) {\n return resourceUrl;\n }\n\n if (resourceUrl.startsWith(RESOURCE_PATH)) {\n return `${origin}${contextPath}${resourceUrl}`;\n }\n\n return `${origin}${contextPath}${RESOURCE_PATH}${resourceUrl}`;\n};\n","import { encode } from \"html-entities\";\n\nimport { IllegalArgumentException } from \"../../exceptions/IllegalArgumentException\";\n\ninterface removeUnwantedHtmlOptions {\n allowedTags?: string[];\n}\n\n/**\n * Translates html entities to their correct decimal equivalent\n * When path is only one deep better use optional chaining\n */\nconst properEntityEncoding = (html: string) => {\n return encode(html, { mode: \"nonAsciiPrintableOnly\", level: \"xml\" });\n};\n\n/**\n * removes unwanted html, this might result in incorrect html, as it removes all html that we don't except,\n * like <b style=\"font-weight: 400\">bold</b> will result in bold</b>\n */\nexport const removeUnwantedHtml = (\n html: string,\n options: removeUnwantedHtmlOptions = {\n allowedTags: [\"p\", \"br\", \"b\", \"i\", \"u\", \"strike\"],\n },\n): string => {\n if (typeof html !== \"string\") {\n throw new IllegalArgumentException(\"sanitizeHTML method expects a string\");\n }\n\n const correctEntityHtml = properEntityEncoding(html);\n\n // remove attributes from html elements\n const htmlWithoutAttributes = correctEntityHtml.replace(\n /<(\\w+)(.|[\\r\\n])*?>/gi,\n \"<$1>\",\n );\n\n const htmlWithCorrectBR = htmlWithoutAttributes.replace(\n /<br\\s*>/gi,\n \"<br />\",\n );\n\n // remove not allowed tags\n const allowedTags = Array.isArray(options.allowedTags)\n ? options.allowedTags.join(\"|\")\n : \"\";\n const pattern = `<(?!\\\\/?(${allowedTags})(>|\\\\s\\\\/))[^<]+?>`;\n const regex = new RegExp(pattern, \"gi\");\n\n return htmlWithCorrectBR.replace(regex, \"\");\n};\n"],"mappings":"gKAMO,IAAMA,EAAk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,CACpE,IAAMC,GAAKF,EAAI,KAAK,OAAO,EAAI,IAAM,GAAK,EAC1C,OAAAA,EAAI,KAAK,MAAMA,EAAI,EAAE,GACbC,IAAM,IAAMC,EAAKA,EAAI,EAAO,GAAK,SAAS,EAAE,CACtD,CAAC,CACH,ECAO,IAAMC,EAA2B,CACtCC,EACAC,EAAsBC,EAAqB,EAC3CC,EAAS,KAELH,EAAY,WAAWG,EAASF,CAAW,EACtCD,EAGLA,EAAY,WAAWI,CAAa,EAC/B,GAAGD,CAAM,GAAGF,CAAW,GAAGD,CAAW,GAGvC,GAAGG,CAAM,GAAGF,CAAW,GAAGG,CAAa,GAAGJ,CAAW,GCpB9D,OAAS,UAAAK,MAAc,gBAYvB,IAAMC,EAAwBC,GACrBC,EAAOD,EAAM,CAAE,KAAM,wBAAyB,MAAO,KAAM,CAAC,EAOxDE,EAAqB,CAChCF,EACAG,EAAqC,CACnC,YAAa,CAAC,IAAK,KAAM,IAAK,IAAK,IAAK,QAAQ,CAClD,IACW,CACX,GAAI,OAAOH,GAAS,SAClB,MAAM,IAAII,EAAyB,sCAAsC,EAW3E,IAAMC,EARoBN,EAAqBC,CAAI,EAGH,QAC9C,wBACA,MACF,EAEgD,QAC9C,YACA,QACF,EAMMM,EAAU,YAHI,MAAM,QAAQH,EAAQ,WAAW,EACjDA,EAAQ,YAAY,KAAK,GAAG,EAC5B,EACmC,sBACjCI,EAAQ,IAAI,OAAOD,EAAS,IAAI,EAEtC,OAAOD,EAAkB,QAAQE,EAAO,EAAE,CAC5C","names":["resourceExists","url","fullUrl","Href","xhr","resourceRedirectsToSecureLogin","responseURL","parseUrl","href","Href","path","hash","querystring","hashSplit","qsSplit","filterParameters","allowedParameters","url","filteredUrl","searchParams","params","param","createHref","context","dynamicPart","entryDate","location","search","finalHref","createUUID","d","c","r","getRepositoryResourceUrl","resourceUrl","contextPath","getContextPathServer","origin","RESOURCE_PATH","encode","properEntityEncoding","html","encode","removeUnwantedHtml","options","IllegalArgumentException","htmlWithCorrectBR","pattern","regex"]}
@@ -1,2 +0,0 @@
1
- import{f as h}from"./chunk-LHZG2ET5.js";import{b as m}from"./chunk-77CGPEAQ.js";var n=m(h(),1);var E=400,i=class e extends Error{id;request;requestOptions;status;response;properties;parameters;constructor(r,t,s){let o=f(r,s);super(o.id),this.name=o.id,this.id=o.id,this.request=t,this.requestOptions=s,this.status=t&&t.status?t.status:E,this.response=r,this.properties=o.properties??{},this.parameters=o.param,Error.captureStackTrace&&Error.captureStackTrace(this,e)}},f=(e,r)=>{let t={id:"Error.CannotRequestResource",defaultMessage:`Cannot request resource ${r?.url??""} with method ${r?.method??"GET"}`,properties:{},param:void 0};if(!e)return t;if((0,n.default)(e,"error"))return{...t,...e.error};let[s]=Object.keys(e);return(0,n.default)(e[s],"errors")?{...t,...e[s].errors}:t};var u=class extends Error{constructor(r){super(r instanceof SyntaxError?r.message:r),this.name="JsonParseException"}};var a=class extends Error{id;status;constructor(r,t){super(`An unexpected network error occurred, cannot request resource ${r} with method ${t}`),this.name="NetworkException",this.id="NetworkException",this.status=0}};var d=class extends Error{id;status;isReload;constructor(r,t,s=!1){super(`Resource ${r} with method ${t} not found`),this.name="NotFoundException",this.id="NotFoundException",this.status=404,this.isReload=s}};var p=class extends Error{constructor(r,t){super(`Timeout occurred in connection to ${r} with method ${t}.`),this.name="TimeoutException"}};var c=class extends Error{id;status;response;constructor(r,t,s){super(`Cannot request resource ${r} with method ${t}`),this.name="UnauthorizedException",this.id="UnauthorizedException",this.status=401,this.response=s}};export{i as a,u as b,a as c,d,p as e,c as f};
2
- //# sourceMappingURL=chunk-FGEQKEJQ.js.map