@ezeep/ezeep-js 1.0.159 → 1.0.163

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 (33) hide show
  1. package/dist/cjs/ezeep.cjs.js +1 -1
  2. package/dist/cjs/ezp-auth_14.cjs.entry.js +68 -152
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/collection/components/ezp-auth/ezp-auth.js +17 -17
  5. package/dist/collection/components/ezp-printer-selection/ezp-printer-selection.js +34 -55
  6. package/dist/collection/components/ezp-printing/ezp-printing.js +33 -1
  7. package/dist/collection/components/ezp-select/ezp-select.js +2 -0
  8. package/dist/collection/services/auth.js +5 -3
  9. package/dist/collection/services/print.js +0 -1
  10. package/dist/custom-elements/index.js +70 -154
  11. package/dist/directives/proxies.ts +1 -1
  12. package/dist/esm/ezeep.js +1 -1
  13. package/dist/esm/ezp-auth_14.entry.js +68 -152
  14. package/dist/esm/loader.js +1 -1
  15. package/dist/esm-es5/ezeep.js +1 -1
  16. package/dist/esm-es5/ezp-auth_14.entry.js +3 -3
  17. package/dist/esm-es5/loader.js +1 -1
  18. package/dist/ezeep/ezeep.esm.js +1 -1
  19. package/dist/ezeep/{p-34ef877e.entry.js → p-2f6827c6.entry.js} +2 -2
  20. package/dist/ezeep/p-80d5c308.system.js +1 -1
  21. package/dist/ezeep/{p-fa41201b.system.entry.js → p-9afa0fdb.system.entry.js} +3 -3
  22. package/dist/types/components/ezp-auth/ezp-auth.d.ts +2 -1
  23. package/dist/types/components/ezp-printer-selection/ezp-printer-selection.d.ts +2 -16
  24. package/dist/types/components/ezp-printing/ezp-printing.d.ts +3 -0
  25. package/dist/types/components.d.ts +1 -0
  26. package/dist/types/services/print.d.ts +1 -1
  27. package/package.json +1 -1
  28. package/readme.md +6 -6
  29. package/www/build/ezeep.esm.js +1 -1
  30. package/www/build/{p-34ef877e.entry.js → p-2f6827c6.entry.js} +2 -2
  31. package/www/build/p-80d5c308.system.js +1 -1
  32. package/www/build/{p-fa41201b.system.entry.js → p-9afa0fdb.system.entry.js} +3 -3
  33. package/www/index.html +5 -6
@@ -3150,9 +3150,11 @@ function sendCodeToParentWindow() {
3150
3150
  const params = new URLSearchParams(window.location.search);
3151
3151
  const code = params.get('code');
3152
3152
  if (window.opener) {
3153
- // send them to the opening window
3154
- window.opener.postMessage(code, authStore.state.redirectUri);
3155
- window.close();
3153
+ if (code) {
3154
+ // send them to the opening window
3155
+ window.opener.postMessage(code, authStore.state.redirectUri);
3156
+ window.close();
3157
+ }
3156
3158
  }
3157
3159
  }
3158
3160
 
@@ -3163,7 +3165,7 @@ let EzpAuth = class {
3163
3165
  registerInstance(this, hostRef);
3164
3166
  this.authCancel = createEvent(this, "authCancel", 7);
3165
3167
  this.authSuccess = createEvent(this, "authSuccess", 7);
3166
- this.windowObjectReference = null;
3168
+ this.oauthPopupWindow = null;
3167
3169
  this.previousUrl = null;
3168
3170
  }
3169
3171
  listenDialogAction() {
@@ -3172,38 +3174,32 @@ let EzpAuth = class {
3172
3174
  listenDialogClose() {
3173
3175
  this.authCancel.emit();
3174
3176
  }
3177
+ listenStatusCancel() {
3178
+ this.authCancel.emit();
3179
+ }
3175
3180
  openSignInWindow(url, name) {
3176
3181
  // remove any existing event listeners
3177
3182
  window.removeEventListener('message', this.receiveMessage);
3178
3183
  // window features
3179
- const strWindowFeatures = 'toolbar=no, menubar=no, width=600, height=7000, top=100, left=100';
3180
- if (this.windowObjectReference === null || this.windowObjectReference.closed) {
3184
+ const windowFeatures = 'toolbar=no, menubar=no, width=600, height=7000, top=100, left=100';
3185
+ if (this.oauthPopupWindow === null || this.oauthPopupWindow.closed) {
3181
3186
  /* if the pointer to the window object in memory does not exist
3182
3187
  or if such pointer exists but the window was closed */
3183
- this.windowObjectReference = window.open(url, name, strWindowFeatures);
3188
+ this.oauthPopupWindow = window.open(url, name, windowFeatures);
3184
3189
  }
3185
3190
  else if (this.previousUrl !== this.auth.authURI.toString()) {
3186
3191
  /* if the resource to load is different,
3187
3192
  then we load it in the already opened secondary window and then
3188
3193
  we bring such window back on top/in front of its parent window. */
3189
- this.windowObjectReference = window.open(url, name, strWindowFeatures);
3190
- this.windowObjectReference.focus();
3194
+ this.oauthPopupWindow = window.open(url, name, windowFeatures);
3195
+ this.oauthPopupWindow.focus();
3191
3196
  }
3192
3197
  else {
3193
3198
  /* else the window reference must exist and the window
3194
3199
  is not closed; therefore, we can bring it back on top of any other
3195
3200
  window with the focus() method. There would be no need to re-create
3196
3201
  the window or to reload the referenced resource. */
3197
- this.windowObjectReference.focus();
3198
- }
3199
- // check if the window was closed and cancel login accordingly
3200
- if (this.hidelogin) {
3201
- let checkClosedTimer = setInterval(() => {
3202
- if (this.windowObjectReference.closed) {
3203
- this.authCancel.emit();
3204
- clearInterval(checkClosedTimer);
3205
- }
3206
- }, 500);
3202
+ this.oauthPopupWindow.focus();
3207
3203
  }
3208
3204
  // add the listener for receiving a message from the popup
3209
3205
  window.addEventListener('message', (event) => this.receiveMessage(event), false);
@@ -3228,7 +3224,7 @@ let EzpAuth = class {
3228
3224
  }
3229
3225
  }
3230
3226
  render() {
3231
- return this.hidelogin ? (h("ezp-status", { description: i18next.t('login_dialog.action'), processing: true })) : (h(Host, null, h("ezp-dialog", { heading: i18next.t('login_dialog.heading'), description: i18next.t('login_dialog.description'), action: i18next.t('login_dialog.action'), iconName: "logo", iconSize: "huge", iconFramed: false, instance: "login" })));
3227
+ return this.hidelogin ? (h("ezp-status", { description: i18next.t('login_dialog.action'), processing: true, cancel: true })) : (h(Host, null, h("ezp-dialog", { heading: i18next.t('login_dialog.heading'), description: i18next.t('login_dialog.description'), action: i18next.t('login_dialog.action'), iconName: "logo", iconSize: "huge", iconFramed: false, instance: "login" })));
3232
3228
  }
3233
3229
  };
3234
3230
  EzpAuth.style = ezpAuthCss;
@@ -32432,7 +32428,6 @@ class EzpPrintService {
32432
32428
  this.clientID = clientID;
32433
32429
  this.printingApi = printStore.state.printApiHostUrl;
32434
32430
  this.checkStoredRefreshToken();
32435
- this.registerFetchInterceptor();
32436
32431
  }
32437
32432
  checkStoredRefreshToken() {
32438
32433
  if (authStore.state.refreshToken !== '') {
@@ -32609,84 +32604,6 @@ const userStore = createStore({
32609
32604
  appearance: '',
32610
32605
  });
32611
32606
 
32612
- const colors = [
32613
- {
32614
- id: 1,
32615
- name: "Grayscale"
32616
- },
32617
- {
32618
- id: 2,
32619
- name: "Color"
32620
- }
32621
- ];
32622
- const orientations = [
32623
- {
32624
- id: 1,
32625
- name: "Portrait"
32626
- },
32627
- {
32628
- id: 2,
32629
- name: "Landscape"
32630
- }
32631
- ];
32632
- const sizes = [
32633
- {
32634
- id: 1,
32635
- name: "Auto",
32636
- description: "Document size"
32637
- },
32638
- {
32639
- id: 2,
32640
- name: "Letter",
32641
- description: "8.5 x 11 in"
32642
- },
32643
- {
32644
- id: 3,
32645
- name: "Ledger",
32646
- description: "11 x 17 in"
32647
- },
32648
- {
32649
- id: 4,
32650
- name: "Legal",
32651
- description: "8.5 x 14 in"
32652
- },
32653
- {
32654
- id: 5,
32655
- name: "Executive",
32656
- description: "7.25 x 10.5 in"
32657
- },
32658
- {
32659
- id: 6,
32660
- name: "A3",
32661
- description: "11.7 x 16.5 in"
32662
- },
32663
- {
32664
- id: 7,
32665
- name: "A4",
32666
- description: "8.3 x 11.7 in"
32667
- },
32668
- {
32669
- id: 8,
32670
- name: "A5",
32671
- description: "5.8 x 8.3 in"
32672
- },
32673
- {
32674
- id: 9,
32675
- name: "Folio",
32676
- description: "8.5 x 13 in"
32677
- },
32678
- {
32679
- id: 10,
32680
- name: "Com-10",
32681
- description: "4.125 x 9.5 in"
32682
- }
32683
- ];
32684
- const options = {
32685
- colors: colors,
32686
- orientations: orientations,
32687
- sizes: sizes
32688
- };
32689
-
32690
32607
  const ezpPrinterSelectionCss = ":host{-ms-flex-line-pack:center;align-content:center;background:var(--ezp-color-overlay-primary);display:grid;grid-template:auto/320px;height:100vh;-ms-flex-pack:center;justify-content:center;left:0;position:fixed;top:0;width:100vw}#box{background:var(--ezp-color-surface-tertiary);border-radius:6px;-webkit-box-shadow:var(--ezp-printerSelection-box-boxShadow, 0 0 0 1px var(--ezp-color-overlay-secondary));box-shadow:var(--ezp-printerSelection-box-boxShadow, 0 0 0 1px var(--ezp-color-overlay-secondary));position:relative}#header{border-radius:6px 6px 0 0;-webkit-box-shadow:var(--ezp-printerSelection-header-boxShadowPosition, 0 1px 0 0) var(--ezp-color-outline);box-shadow:var(--ezp-printerSelection-header-boxShadowPosition, 0 1px 0 0) var(--ezp-color-outline);color:var(--ezp-color-foreground-primary);display:grid;grid-column-gap:var(--ezp-spacing-1);grid-template-columns:auto 1fr auto;padding:var(--ezp-spacing-4) var(--ezp-spacing-3) var(--ezp-spacing-4) var(--ezp-spacing-4);position:relative;z-index:3}#toggle-menu{margin:calc(var(--ezp-spacing-3) * -1) 0;position:relative;z-index:2}#body{background:var(--ezp-color-surface-secondary);-webkit-box-shadow:var(--ezp-printerSelection-body-boxShadow, none);box-shadow:var(--ezp-printerSelection-body-boxShadow, none);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--ezp-spacing-2);padding:var(--ezp-spacing-2)}#footer{border-radius:0 0 6px 6px;-webkit-box-shadow:var(--ezp-printerSelection-footer-boxShadowPosition, 0 -1px 0 0) var(--ezp-color-outline);box-shadow:var(--ezp-printerSelection-footer-boxShadowPosition, 0 -1px 0 0) var(--ezp-color-outline);display:grid;grid-column-gap:var(--ezp-spacing-2);grid-template-columns:repeat(2, 1fr);padding:var(--ezp-spacing-2);position:relative;z-index:3}";
32691
32608
 
32692
32609
  let EzpPrinterSelection = class {
@@ -32717,7 +32634,6 @@ let EzpPrinterSelection = class {
32717
32634
  *
32718
32635
  */
32719
32636
  this.loading = true;
32720
- this.options = options;
32721
32637
  this.printProcessing = false;
32722
32638
  this.uploading = false;
32723
32639
  this.preparingUpload = false;
@@ -32763,12 +32679,13 @@ let EzpPrinterSelection = class {
32763
32679
  return false;
32764
32680
  };
32765
32681
  this.POLL_INTERVAL = 2000;
32682
+ this.MAX_POLL_ATTEMPTS = 1000;
32766
32683
  /** Description... */
32767
32684
  this.handlePrint = async () => {
32768
32685
  this.printProcessing = true;
32769
32686
  // we have to initialse this obj with empty strings to display the select component
32770
32687
  // but don't want to send any attributes with empty strings to the API
32771
- this.selectedProperties = removeEmptyStrings(this.selectedProperties);
32688
+ const cleanPrintProperties = removeEmptyStrings(this.selectedProperties);
32772
32689
  // put it in store for further use
32773
32690
  printStore.state.fileUrl = this.fileurl;
32774
32691
  printStore.state.fileID = this.fileid;
@@ -32778,11 +32695,11 @@ let EzpPrinterSelection = class {
32778
32695
  printStore.state.fileName = this.filename;
32779
32696
  if (this.fileurl) {
32780
32697
  this.printService
32781
- .printFileByUrl(authStore.state.accessToken, this.fileurl, this.filetype, this.selectedPrinter.id, this.selectedProperties, this.filename)
32698
+ .printFileByUrl(authStore.state.accessToken, this.fileurl, this.filetype, this.selectedPrinter.id, cleanPrintProperties, this.filename)
32782
32699
  .then((response) => {
32783
32700
  if (response.status === 412) {
32784
32701
  response.json().then((data) => (this.fileid = data.fileid));
32785
- this.printService.printByFileID(authStore.state.accessToken, this.fileid, this.filetype, this.selectedPrinter.id, this.selectedProperties, this.filename);
32702
+ this.printService.printByFileID(authStore.state.accessToken, this.fileid, this.filetype, this.selectedPrinter.id, cleanPrintProperties, this.filename);
32786
32703
  }
32787
32704
  else {
32788
32705
  return response.json();
@@ -32799,7 +32716,7 @@ let EzpPrinterSelection = class {
32799
32716
  fn: this.printService.getPrintStatus,
32800
32717
  validate: this.validateData,
32801
32718
  interval: this.POLL_INTERVAL,
32802
- maxAttempts: 30,
32719
+ maxAttempts: this.MAX_POLL_ATTEMPTS,
32803
32720
  }).catch((err) => {
32804
32721
  console.warn(err);
32805
32722
  this.printFailed = true;
@@ -32818,7 +32735,7 @@ let EzpPrinterSelection = class {
32818
32735
  });
32819
32736
  }
32820
32737
  if (this.file) {
32821
- await this.handleFiles(this.file);
32738
+ await this.handleFiles(this.file, cleanPrintProperties);
32822
32739
  }
32823
32740
  localStorage.setItem('properties', JSON.stringify(this.selectedProperties));
32824
32741
  localStorage.setItem('printer', JSON.stringify(this.selectedPrinter));
@@ -32913,16 +32830,24 @@ let EzpPrinterSelection = class {
32913
32830
  break;
32914
32831
  case 'color':
32915
32832
  this.selectedProperties.color = !!eventDetails.id;
32833
+ // console.log('color selected:')
32834
+ // console.log(this.selectedProperties.color)
32916
32835
  break;
32917
32836
  case 'orientation':
32918
32837
  this.selectedProperties.orientation = eventDetails.id;
32838
+ // console.log('orientation selected:')
32839
+ // console.log(this.selectedProperties.orientation)
32919
32840
  break;
32920
32841
  case 'format':
32921
32842
  this.selectedProperties.paper = eventDetails.title;
32922
32843
  this.selectedProperties.paperid = eventDetails.id;
32844
+ // console.log('paper selected:')
32845
+ // console.log(this.selectedProperties.paper)
32923
32846
  break;
32924
32847
  case 'quality':
32925
32848
  this.selectedProperties.resolution = eventDetails.title;
32849
+ // console.log('quality selected:')
32850
+ // console.log(this.selectedProperties.resolution)
32926
32851
  break;
32927
32852
  case 'duplex':
32928
32853
  if (eventDetails.title === 'None') {
@@ -32932,10 +32857,12 @@ let EzpPrinterSelection = class {
32932
32857
  this.selectedProperties.duplex = true;
32933
32858
  }
32934
32859
  this.selectedProperties.duplexmode = eventDetails.id;
32860
+ // console.log('duplex selected:')
32861
+ // console.log(this.selectedProperties.duplexmode)
32935
32862
  break;
32936
32863
  }
32937
32864
  }
32938
- async handleFiles(file) {
32865
+ async handleFiles(file, printPorperties) {
32939
32866
  this.preparingUpload = true;
32940
32867
  const response = await this.printService.prepareFileUpload(authStore.state.accessToken);
32941
32868
  this.preparingUpload = false;
@@ -32954,7 +32881,7 @@ let EzpPrinterSelection = class {
32954
32881
  this.uploading = false;
32955
32882
  if (res._response.status === 201) {
32956
32883
  this.printService
32957
- .printByFileID(authStore.state.accessToken, this.fileid, this.filetype, this.selectedPrinter.id, this.selectedProperties, this.filename)
32884
+ .printByFileID(authStore.state.accessToken, this.fileid, this.filetype, this.selectedPrinter.id, printPorperties, this.filename)
32958
32885
  .then((data) => {
32959
32886
  if (data.code === 804) {
32960
32887
  this.printFailed = true;
@@ -32966,7 +32893,7 @@ let EzpPrinterSelection = class {
32966
32893
  fn: this.printService.getPrintStatus,
32967
32894
  validate: this.validateData,
32968
32895
  interval: this.POLL_INTERVAL,
32969
- maxAttempts: 30,
32896
+ maxAttempts: this.MAX_POLL_ATTEMPTS,
32970
32897
  }).catch((err) => {
32971
32898
  console.log(err);
32972
32899
  this.printFailed = true;
@@ -33001,8 +32928,8 @@ let EzpPrinterSelection = class {
33001
32928
  else {
33002
32929
  format = 'A4';
33003
32930
  }
33004
- this.selectedProperties.paper = this.selectedPrinterConfig.PaperFormats.find((el) => el.Name === format).Name;
33005
- this.selectedProperties.paperid = this.selectedPrinterConfig.PaperFormats.find((el) => el.Name === format).Id;
32931
+ this.selectedProperties.paper = this.selectedPrinterConfig.PaperFormats.find((el) => el.Name.includes(format)).Name;
32932
+ this.selectedProperties.paperid = this.selectedPrinterConfig.PaperFormats.find((el) => el.Name.includes(format)).Id;
33006
32933
  }
33007
32934
  /**
33008
32935
  *
@@ -33012,8 +32939,9 @@ let EzpPrinterSelection = class {
33012
32939
  /** Description... */
33013
32940
  async connectedCallback() {
33014
32941
  this.getPropertiesFromLocalStorage();
33015
- this.getUserInfo();
33016
32942
  this.printService = new EzpPrintService(this.redirectURI, this.clientID);
32943
+ this.printService.registerFetchInterceptor();
32944
+ await this.getUserInfo();
33017
32945
  // if printer is stored from previous print, get the config to enable property selection
33018
32946
  if (this.selectedPrinter.id != '') {
33019
32947
  await this.printService
@@ -33093,25 +33021,9 @@ let EzpPrinterSelection = class {
33093
33021
  },
33094
33022
  ],
33095
33023
  // preSelected={
33096
- // this.selectedProperties.color ?
33097
- // [
33098
- // {
33099
- // id: 1,
33100
- // title: i18next.t('printer_selection.color'),
33101
- // meta: '',
33102
- // type: 'color',
33103
- // },
33104
- // ]
33105
- // : !this.selectedProperties.color ?
33106
- // [
33107
- // {
33108
- // id: 0,
33109
- // title: i18next.t('printer_selection.color_grayscale'),
33110
- // meta: '',
33111
- // type: 'color',
33112
- // },
33113
- // ]
33114
- // : null
33024
+ // this.selectedProperties.color
33025
+ // ? i18next.t('printer_selection.color_color')
33026
+ // : i18next.t('printer_selection.color_grayscale')
33115
33027
  // }
33116
33028
  disabled: !this.selectedPrinterConfig.Color }), h("ezp-select", { label: i18next.t('printer_selection.duplex'), icon: "duplex", placeholder: i18next.t('printer_selection.select_duplex'), toggleFlow: "horizontal", options: this.duplexOptions.map((option) => ({
33117
33029
  id: option.id,
@@ -33121,9 +33033,9 @@ let EzpPrinterSelection = class {
33121
33033
  })),
33122
33034
  // preSelected={
33123
33035
  // this.selectedProperties.duplex
33124
- // ? this.selectedProperties.duplex
33125
- // // : this.selectedPrinterConfig.DuplexSupported
33126
- // // ? 'None'
33036
+ // ? this.duplexOptions.find(
33037
+ // (option) => option.id === this.selectedProperties.duplexmode
33038
+ // ).id
33127
33039
  // : null
33128
33040
  // }
33129
33041
  disabled: !this.selectedPrinterConfig.DuplexSupported }), h("ezp-select", { label: i18next.t('printer_selection.size'), icon: "size", placeholder: i18next.t('printer_selection.select_size'), toggleFlow: "horizontal", optionFlow: "horizontal", options: this.selectedPrinterConfig.PaperFormats.map((format) => ({
@@ -33132,27 +33044,17 @@ let EzpPrinterSelection = class {
33132
33044
  meta: `${format.XRes} x ${format.YRes}`,
33133
33045
  type: 'format',
33134
33046
  })),
33135
- // preSelected={
33136
- // this.selectedProperties.paper
33137
- // ? this.selectedProperties.paper
33138
- // // : this.selectedPrinterConfig.PaperFormats.length > 0
33139
- // // ? this.selectedPrinterConfig.PaperFormats[0].Name
33140
- // : null
33141
- // }
33047
+ // preSelected={this.selectedProperties.paper ? this.selectedProperties.paper : null}
33142
33048
  disabled: !(this.selectedPrinterConfig.PaperFormats.length > 0) }), h("ezp-select", { label: i18next.t('printer_selection.orientation'), icon: "orientation", placeholder: i18next.t('printer_selection.select_orientation'), toggleFlow: "horizontal", options: this.selectedPrinterConfig.OrientationsSupported.map((orientation, index) => ({
33143
- id: index,
33049
+ id: index + 1,
33144
33050
  title: i18next.t(`printer_selection.orientation_${orientation}`),
33145
33051
  meta: '',
33146
33052
  type: 'orientation',
33147
33053
  })),
33148
33054
  // preSelected={
33149
33055
  // this.selectedProperties.orientation
33150
- // ? this.selectedProperties.orientation
33151
- // // : this.selectedPrinterConfig.OrientationsSupported.length > 0
33152
- // // ? i18next.t(
33153
- // // `printer_selection.orientation_${this.selectedPrinterConfig.OrientationsSupported[0]}`
33154
- // // )
33155
- // : null
33056
+ // ? this.selectedProperties.orientation
33057
+ // : null
33156
33058
  // }
33157
33059
  disabled: !(this.selectedPrinterConfig.OrientationsSupported.length > 0) }), h("ezp-select", { label: i18next.t('printer_selection.quality'), icon: "quality", placeholder: i18next.t('printer_selection.select_quality'), toggleFlow: "horizontal", options: this.selectedPrinterConfig.Resolutions.map((option, index) => ({
33158
33060
  id: index,
@@ -33161,11 +33063,7 @@ let EzpPrinterSelection = class {
33161
33063
  type: 'quality',
33162
33064
  })),
33163
33065
  // preSelected={
33164
- // this.selectedProperties.resolution
33165
- // ? this.selectedProperties.resolution
33166
- // // : this.selectedPrinterConfig.Resolutions.length > 0
33167
- // // ? this.selectedPrinterConfig.Resolutions[0]
33168
- // : null
33066
+ // this.selectedProperties.resolution ? this.selectedProperties.resolution : null
33169
33067
  // }
33170
33068
  disabled: !(this.selectedPrinterConfig.Resolutions.length > 0) })), h("ezp-stepper", { label: i18next.t('printer_selection.copies'), max: 10, icon: "copies" })), h("div", { id: "footer" }, h("ezp-text-button", { type: "button", level: "secondary", onClick: this.handleCancel, label: i18next.t('button_actions.cancel') }), h("ezp-text-button", { disabled: this.selectedPrinter.id === '', type: "button", onClick: this.handlePrint, label: i18next.t('button_actions.print') })), !this.hidemenu && h("ezp-user-menu", { open: this.userMenuOpen, name: this.userName }))));
33171
33069
  }
@@ -33265,6 +33163,13 @@ let EzpPrinting = class {
33265
33163
  localStorage.removeItem('isAuthorized');
33266
33164
  this.printOpen = false;
33267
33165
  }
33166
+ async getSasUri() {
33167
+ const printService = new EzpPrintService(this.redirecturi, this.clientid);
33168
+ const response = await printService.prepareFileUpload(authStore.state.accessToken)
33169
+ .catch(() => this.open());
33170
+ const sasUri = response.sasUri;
33171
+ return sasUri;
33172
+ }
33268
33173
  checkAuth() {
33269
33174
  const printService = new EzpPrintService(this.redirecturi, this.clientid);
33270
33175
  let accessToken = authStore.state.accessToken;
@@ -33290,6 +33195,12 @@ let EzpPrinting = class {
33290
33195
  authStore.state.isAuthorized = false;
33291
33196
  });
33292
33197
  }
33198
+ refreshTokensPeriodically(seconds) {
33199
+ const authService = new EzpAuthorizationService(this.redirecturi, this.clientid);
33200
+ setInterval(() => {
33201
+ authService.refreshTokens();
33202
+ }, seconds * 1000);
33203
+ }
33293
33204
  componentWillLoad() {
33294
33205
  const systemAppearanceDark = window.matchMedia('(prefers-color-scheme: dark)');
33295
33206
  this.systemAppearance = systemAppearanceDark.matches ? 'dark' : 'light';
@@ -33315,6 +33226,9 @@ let EzpPrinting = class {
33315
33226
  sendCodeToParentWindow();
33316
33227
  this.checkAuth();
33317
33228
  }
33229
+ componentDidLoad() {
33230
+ this.refreshTokensPeriodically(1800);
33231
+ }
33318
33232
  /**
33319
33233
  *
33320
33234
  * Render method
@@ -33383,6 +33297,8 @@ let EzpSelect = class {
33383
33297
  const delay = this.selected.id === id ? 0 : this.duration * 1000;
33384
33298
  this.selected = this.options.find((option) => option.id === id);
33385
33299
  this.selectSelection.emit(this.selected);
33300
+ // console.log('ezp-select:')
33301
+ // console.log(this.selected)
33386
33302
  window.setTimeout(() => {
33387
33303
  this.toggle();
33388
33304
  }, delay);
@@ -12,7 +12,7 @@ const defineCustomElements = (win, options) => {
12
12
  if (typeof window === 'undefined') return Promise.resolve();
13
13
  return patchEsm().then(() => {
14
14
  globalScripts();
15
- return bootstrapLazy([["ezp-auth_14",[[1,"ezp-printing",{"clientid":[1],"redirecturi":[1],"filename":[1025],"fileurl":[1],"filetype":[1],"custom":[4],"hidelogin":[4],"hidemenu":[4],"authapihosturl":[1],"printapihosturl":[1],"theme":[1],"fileid":[1],"appearance":[1],"trigger":[1],"language":[1],"printOpen":[32],"authOpen":[32],"noDocumentOpen":[32],"systemAppearance":[32],"open":[64],"logOut":[64]},[[0,"printCancel","listenPrintCancel"],[0,"printSubmit","listenPrintSubmit"],[0,"authCancel","listenAuthCancel"],[0,"authSuccess","listenAuthSuccess"],[0,"uploadFile","listenUploadFile"],[0,"dialogClose","listenDialogClose"],[0,"dialogAction","listenDialogAction"]]],[1,"ezp-printer-selection",{"clientID":[1,"client-i-d"],"redirectURI":[1,"redirect-u-r-i"],"filename":[1025],"fileurl":[1],"filetype":[1025],"fileid":[1025],"file":[16],"hidemenu":[4],"loading":[32],"options":[32],"printProcessing":[32],"uploading":[32],"preparingUpload":[32],"printSuccess":[32],"printFailed":[32],"notSupported":[32],"noPrinters":[32],"userMenuOpen":[32],"printStopped":[32],"userName":[32],"printers":[32],"selectedPrinter":[32],"printerConfig":[32],"selectedPrinterConfig":[32],"selectedProperties":[32]},[[0,"selectSelection","listenSelectSelection"],[0,"stepperChanged","listenStepperChanged"],[0,"userMenuClosure","listenUserMenuClosure"],[0,"logoutEmitter","listenLogout"],[0,"statusCancel","listenStatusCancel"],[0,"statusClose","listenStatusClose"],[0,"statusRetry","listenStatusRetry"]]],[1,"ezp-auth",{"clientID":[1025,"client-i-d"],"redirectURI":[1025,"redirect-u-r-i"],"hidelogin":[4],"auth":[32],"authURI":[32],"accessToken":[32]},[[0,"dialogAction","listenDialogAction"],[0,"dialogClose","listenDialogClose"]]],[1,"ezp-upload",{"dragging":[32]},[[1,"dragenter","handleDragEnter"],[0,"dragover","handleDragOver"],[1,"dragleave","handleDragLeave"],[0,"drop","handleDrop"]]],[1,"ezp-dialog",{"heading":[1],"description":[1],"action":[1],"iconName":[1,"icon-name"],"iconSize":[1,"icon-size"],"iconFramed":[4,"icon-framed"],"instance":[1]}],[1,"ezp-user-menu",{"name":[1],"open":[1028]}],[1,"ezp-select",{"icon":[1],"label":[1],"optionFlow":[1,"option-flow"],"options":[16],"placeholder":[1],"preSelected":[8,"pre-selected"],"toggleFlow":[1,"toggle-flow"],"disabled":[4],"expanded":[32],"selected":[32]}],[1,"ezp-stepper",{"icon":[1],"label":[1],"max":[2],"min":[2],"canDecrease":[32],"canIncrease":[32],"focused":[32],"value":[32]}],[1,"ezp-status",{"description":[1],"processing":[4],"instance":[1],"icon":[1],"cancel":[8],"close":[8],"retry":[8]}],[1,"ezp-backdrop",{"visible":[1028]},[[0,"animationend","listenAnimationEnd"]]],[1,"ezp-icon-button",{"blank":[4],"disabled":[4],"href":[1],"icon":[1],"level":[1],"type":[1]}],[1,"ezp-text-button",{"blank":[4],"disabled":[4],"href":[1],"level":[1],"label":[1],"type":[1],"small":[4]}],[1,"ezp-icon",{"name":[1],"size":[1],"framed":[4]}],[1,"ezp-label",{"ellipsis":[4],"level":[1],"noWrap":[4,"no-wrap"],"text":[1],"weight":[1]}]]]], options);
15
+ return bootstrapLazy([["ezp-auth_14",[[1,"ezp-printing",{"clientid":[1],"redirecturi":[1],"filename":[1025],"fileurl":[1],"filetype":[1],"custom":[4],"hidelogin":[4],"hidemenu":[4],"authapihosturl":[1],"printapihosturl":[1],"theme":[1],"fileid":[1],"appearance":[1],"trigger":[1],"language":[1],"printOpen":[32],"authOpen":[32],"noDocumentOpen":[32],"systemAppearance":[32],"open":[64],"logOut":[64],"getSasUri":[64]},[[0,"printCancel","listenPrintCancel"],[0,"printSubmit","listenPrintSubmit"],[0,"authCancel","listenAuthCancel"],[0,"authSuccess","listenAuthSuccess"],[0,"uploadFile","listenUploadFile"],[0,"dialogClose","listenDialogClose"],[0,"dialogAction","listenDialogAction"]]],[1,"ezp-printer-selection",{"clientID":[1,"client-i-d"],"redirectURI":[1,"redirect-u-r-i"],"filename":[1025],"fileurl":[1],"filetype":[1025],"fileid":[1025],"file":[16],"hidemenu":[4],"loading":[32],"printProcessing":[32],"uploading":[32],"preparingUpload":[32],"printSuccess":[32],"printFailed":[32],"notSupported":[32],"noPrinters":[32],"userMenuOpen":[32],"printStopped":[32],"userName":[32],"printers":[32],"selectedPrinter":[32],"printerConfig":[32],"selectedPrinterConfig":[32],"selectedProperties":[32]},[[0,"selectSelection","listenSelectSelection"],[0,"stepperChanged","listenStepperChanged"],[0,"userMenuClosure","listenUserMenuClosure"],[0,"logoutEmitter","listenLogout"],[0,"statusCancel","listenStatusCancel"],[0,"statusClose","listenStatusClose"],[0,"statusRetry","listenStatusRetry"]]],[1,"ezp-auth",{"clientID":[1025,"client-i-d"],"redirectURI":[1025,"redirect-u-r-i"],"hidelogin":[4],"auth":[32],"authURI":[32],"accessToken":[32]},[[0,"dialogAction","listenDialogAction"],[0,"dialogClose","listenDialogClose"],[0,"statusCancel","listenStatusCancel"]]],[1,"ezp-upload",{"dragging":[32]},[[1,"dragenter","handleDragEnter"],[0,"dragover","handleDragOver"],[1,"dragleave","handleDragLeave"],[0,"drop","handleDrop"]]],[1,"ezp-dialog",{"heading":[1],"description":[1],"action":[1],"iconName":[1,"icon-name"],"iconSize":[1,"icon-size"],"iconFramed":[4,"icon-framed"],"instance":[1]}],[1,"ezp-user-menu",{"name":[1],"open":[1028]}],[1,"ezp-select",{"icon":[1],"label":[1],"optionFlow":[1,"option-flow"],"options":[16],"placeholder":[1],"preSelected":[8,"pre-selected"],"toggleFlow":[1,"toggle-flow"],"disabled":[4],"expanded":[32],"selected":[32]}],[1,"ezp-stepper",{"icon":[1],"label":[1],"max":[2],"min":[2],"canDecrease":[32],"canIncrease":[32],"focused":[32],"value":[32]}],[1,"ezp-status",{"description":[1],"processing":[4],"instance":[1],"icon":[1],"cancel":[8],"close":[8],"retry":[8]}],[1,"ezp-backdrop",{"visible":[1028]},[[0,"animationend","listenAnimationEnd"]]],[1,"ezp-icon-button",{"blank":[4],"disabled":[4],"href":[1],"icon":[1],"level":[1],"type":[1]}],[1,"ezp-text-button",{"blank":[4],"disabled":[4],"href":[1],"level":[1],"label":[1],"type":[1],"small":[4]}],[1,"ezp-icon",{"name":[1],"size":[1],"framed":[4]}],[1,"ezp-label",{"ellipsis":[4],"level":[1],"noWrap":[4,"no-wrap"],"text":[1],"weight":[1]}]]]], options);
16
16
  });
17
17
  };
18
18
 
@@ -1 +1 @@
1
- import{p as promiseResolve,b as bootstrapLazy}from"./index-18d4bf15.js";import{g as globalScripts}from"./app-globals-28960cbc.js";var patchBrowser=function(){var e=import.meta.url;var i={};if(e!==""){i.resourcesUrl=new URL(".",e).href}return promiseResolve(i)};patchBrowser().then((function(e){globalScripts();return bootstrapLazy([["ezp-auth_14",[[1,"ezp-printing",{clientid:[1],redirecturi:[1],filename:[1025],fileurl:[1],filetype:[1],custom:[4],hidelogin:[4],hidemenu:[4],authapihosturl:[1],printapihosturl:[1],theme:[1],fileid:[1],appearance:[1],trigger:[1],language:[1],printOpen:[32],authOpen:[32],noDocumentOpen:[32],systemAppearance:[32],open:[64],logOut:[64]},[[0,"printCancel","listenPrintCancel"],[0,"printSubmit","listenPrintSubmit"],[0,"authCancel","listenAuthCancel"],[0,"authSuccess","listenAuthSuccess"],[0,"uploadFile","listenUploadFile"],[0,"dialogClose","listenDialogClose"],[0,"dialogAction","listenDialogAction"]]],[1,"ezp-printer-selection",{clientID:[1,"client-i-d"],redirectURI:[1,"redirect-u-r-i"],filename:[1025],fileurl:[1],filetype:[1025],fileid:[1025],file:[16],hidemenu:[4],loading:[32],options:[32],printProcessing:[32],uploading:[32],preparingUpload:[32],printSuccess:[32],printFailed:[32],notSupported:[32],noPrinters:[32],userMenuOpen:[32],printStopped:[32],userName:[32],printers:[32],selectedPrinter:[32],printerConfig:[32],selectedPrinterConfig:[32],selectedProperties:[32]},[[0,"selectSelection","listenSelectSelection"],[0,"stepperChanged","listenStepperChanged"],[0,"userMenuClosure","listenUserMenuClosure"],[0,"logoutEmitter","listenLogout"],[0,"statusCancel","listenStatusCancel"],[0,"statusClose","listenStatusClose"],[0,"statusRetry","listenStatusRetry"]]],[1,"ezp-auth",{clientID:[1025,"client-i-d"],redirectURI:[1025,"redirect-u-r-i"],hidelogin:[4],auth:[32],authURI:[32],accessToken:[32]},[[0,"dialogAction","listenDialogAction"],[0,"dialogClose","listenDialogClose"]]],[1,"ezp-upload",{dragging:[32]},[[1,"dragenter","handleDragEnter"],[0,"dragover","handleDragOver"],[1,"dragleave","handleDragLeave"],[0,"drop","handleDrop"]]],[1,"ezp-dialog",{heading:[1],description:[1],action:[1],iconName:[1,"icon-name"],iconSize:[1,"icon-size"],iconFramed:[4,"icon-framed"],instance:[1]}],[1,"ezp-user-menu",{name:[1],open:[1028]}],[1,"ezp-select",{icon:[1],label:[1],optionFlow:[1,"option-flow"],options:[16],placeholder:[1],preSelected:[8,"pre-selected"],toggleFlow:[1,"toggle-flow"],disabled:[4],expanded:[32],selected:[32]}],[1,"ezp-stepper",{icon:[1],label:[1],max:[2],min:[2],canDecrease:[32],canIncrease:[32],focused:[32],value:[32]}],[1,"ezp-status",{description:[1],processing:[4],instance:[1],icon:[1],cancel:[8],close:[8],retry:[8]}],[1,"ezp-backdrop",{visible:[1028]},[[0,"animationend","listenAnimationEnd"]]],[1,"ezp-icon-button",{blank:[4],disabled:[4],href:[1],icon:[1],level:[1],type:[1]}],[1,"ezp-text-button",{blank:[4],disabled:[4],href:[1],level:[1],label:[1],type:[1],small:[4]}],[1,"ezp-icon",{name:[1],size:[1],framed:[4]}],[1,"ezp-label",{ellipsis:[4],level:[1],noWrap:[4,"no-wrap"],text:[1],weight:[1]}]]]],e)}));
1
+ import{p as promiseResolve,b as bootstrapLazy}from"./index-18d4bf15.js";import{g as globalScripts}from"./app-globals-28960cbc.js";var patchBrowser=function(){var e=import.meta.url;var t={};if(e!==""){t.resourcesUrl=new URL(".",e).href}return promiseResolve(t)};patchBrowser().then((function(e){globalScripts();return bootstrapLazy([["ezp-auth_14",[[1,"ezp-printing",{clientid:[1],redirecturi:[1],filename:[1025],fileurl:[1],filetype:[1],custom:[4],hidelogin:[4],hidemenu:[4],authapihosturl:[1],printapihosturl:[1],theme:[1],fileid:[1],appearance:[1],trigger:[1],language:[1],printOpen:[32],authOpen:[32],noDocumentOpen:[32],systemAppearance:[32],open:[64],logOut:[64],getSasUri:[64]},[[0,"printCancel","listenPrintCancel"],[0,"printSubmit","listenPrintSubmit"],[0,"authCancel","listenAuthCancel"],[0,"authSuccess","listenAuthSuccess"],[0,"uploadFile","listenUploadFile"],[0,"dialogClose","listenDialogClose"],[0,"dialogAction","listenDialogAction"]]],[1,"ezp-printer-selection",{clientID:[1,"client-i-d"],redirectURI:[1,"redirect-u-r-i"],filename:[1025],fileurl:[1],filetype:[1025],fileid:[1025],file:[16],hidemenu:[4],loading:[32],printProcessing:[32],uploading:[32],preparingUpload:[32],printSuccess:[32],printFailed:[32],notSupported:[32],noPrinters:[32],userMenuOpen:[32],printStopped:[32],userName:[32],printers:[32],selectedPrinter:[32],printerConfig:[32],selectedPrinterConfig:[32],selectedProperties:[32]},[[0,"selectSelection","listenSelectSelection"],[0,"stepperChanged","listenStepperChanged"],[0,"userMenuClosure","listenUserMenuClosure"],[0,"logoutEmitter","listenLogout"],[0,"statusCancel","listenStatusCancel"],[0,"statusClose","listenStatusClose"],[0,"statusRetry","listenStatusRetry"]]],[1,"ezp-auth",{clientID:[1025,"client-i-d"],redirectURI:[1025,"redirect-u-r-i"],hidelogin:[4],auth:[32],authURI:[32],accessToken:[32]},[[0,"dialogAction","listenDialogAction"],[0,"dialogClose","listenDialogClose"],[0,"statusCancel","listenStatusCancel"]]],[1,"ezp-upload",{dragging:[32]},[[1,"dragenter","handleDragEnter"],[0,"dragover","handleDragOver"],[1,"dragleave","handleDragLeave"],[0,"drop","handleDrop"]]],[1,"ezp-dialog",{heading:[1],description:[1],action:[1],iconName:[1,"icon-name"],iconSize:[1,"icon-size"],iconFramed:[4,"icon-framed"],instance:[1]}],[1,"ezp-user-menu",{name:[1],open:[1028]}],[1,"ezp-select",{icon:[1],label:[1],optionFlow:[1,"option-flow"],options:[16],placeholder:[1],preSelected:[8,"pre-selected"],toggleFlow:[1,"toggle-flow"],disabled:[4],expanded:[32],selected:[32]}],[1,"ezp-stepper",{icon:[1],label:[1],max:[2],min:[2],canDecrease:[32],canIncrease:[32],focused:[32],value:[32]}],[1,"ezp-status",{description:[1],processing:[4],instance:[1],icon:[1],cancel:[8],close:[8],retry:[8]}],[1,"ezp-backdrop",{visible:[1028]},[[0,"animationend","listenAnimationEnd"]]],[1,"ezp-icon-button",{blank:[4],disabled:[4],href:[1],icon:[1],level:[1],type:[1]}],[1,"ezp-text-button",{blank:[4],disabled:[4],href:[1],level:[1],label:[1],type:[1],small:[4]}],[1,"ezp-icon",{name:[1],size:[1],framed:[4]}],[1,"ezp-label",{ellipsis:[4],level:[1],noWrap:[4,"no-wrap"],text:[1],weight:[1]}]]]],e)}));