@postnord/pn-marketweb-components 1.0.7 → 1.0.8

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 (81) hide show
  1. package/cjs/loader.cjs.js +1 -1
  2. package/cjs/pn-choice-button_2.cjs.entry.js +2 -2
  3. package/cjs/{pn-find-service-and-price-store-7ced0e29.js → pn-find-service-and-price-store-56d8b760.js} +3 -1
  4. package/cjs/pn-find-service-and-price.cjs.entry.js +37 -20
  5. package/cjs/pn-market-web-components.cjs.js +1 -1
  6. package/cjs/pn-product-pricelist-result.cjs.entry.js +13 -2
  7. package/cjs/{pn-product-pricelist-store-ffd73312.js → pn-product-pricelist-store-e4f8503b.js} +5 -1
  8. package/cjs/pn-product-pricelist.cjs.entry.js +114 -5
  9. package/cjs/pn-product-tile_3.cjs.entry.js +4 -4
  10. package/collection/components/widgets/pn-find-service-and-price/find-service-and-price.stories.js +1 -1
  11. package/collection/components/widgets/pn-find-service-and-price/pn-find-service-and-price-result.js +4 -4
  12. package/collection/components/widgets/pn-find-service-and-price/pn-find-service-and-price-store.js +3 -1
  13. package/collection/components/widgets/pn-find-service-and-price/pn-find-service-and-price-translations.js +10 -0
  14. package/collection/components/widgets/pn-find-service-and-price/pn-find-service-and-price.css +5 -1
  15. package/collection/components/widgets/pn-find-service-and-price/pn-find-service-and-price.js +25 -18
  16. package/collection/components/widgets/pn-product-pricelist/data.js +17 -15
  17. package/collection/components/widgets/pn-product-pricelist/pn-product-pricelist-result.js +22 -7
  18. package/collection/components/widgets/pn-product-pricelist/pn-product-pricelist-store.js +5 -1
  19. package/collection/components/widgets/pn-product-pricelist/pn-product-pricelist-translations.js +20 -0
  20. package/collection/components/widgets/pn-product-pricelist/pn-product-pricelist.css +50 -1
  21. package/collection/components/widgets/pn-product-pricelist/pn-product-pricelist.js +76 -2
  22. package/collection/components/widgets/pn-product-pricelist/pn-product-pricelist.stories.js +1 -1
  23. package/collection/components/widgets/pn-product-tile/pn-product-tile-price.css +5 -3
  24. package/collection/components/widgets/pn-product-tile/pn-product-tile-price.js +6 -11
  25. package/collection/components/widgets/pn-product-tile/pn-product-tile.css +4 -4
  26. package/collection/components/widgets/pn-product-tile/pn-product-tile.js +3 -3
  27. package/custom-elements/index.js +184 -41
  28. package/esm/loader.js +1 -1
  29. package/esm/pn-choice-button_2.entry.js +2 -2
  30. package/esm/{pn-find-service-and-price-store-0c7083bd.js → pn-find-service-and-price-store-d02cbfe1.js} +3 -1
  31. package/esm/pn-find-service-and-price.entry.js +37 -20
  32. package/esm/pn-market-web-components.js +1 -1
  33. package/esm/pn-product-pricelist-result.entry.js +13 -2
  34. package/esm/{pn-product-pricelist-store-82211c4a.js → pn-product-pricelist-store-6259b354.js} +5 -1
  35. package/esm/pn-product-pricelist.entry.js +114 -5
  36. package/esm/pn-product-tile_3.entry.js +4 -4
  37. package/esm-es5/loader.js +1 -1
  38. package/esm-es5/pn-choice-button_2.entry.js +1 -1
  39. package/esm-es5/{pn-find-service-and-price-store-0c7083bd.js → pn-find-service-and-price-store-d02cbfe1.js} +1 -1
  40. package/esm-es5/pn-find-service-and-price.entry.js +1 -1
  41. package/esm-es5/pn-market-web-components.js +1 -1
  42. package/esm-es5/pn-product-pricelist-result.entry.js +1 -1
  43. package/esm-es5/pn-product-pricelist-store-6259b354.js +1 -0
  44. package/esm-es5/pn-product-pricelist.entry.js +1 -1
  45. package/esm-es5/pn-product-tile_3.entry.js +1 -1
  46. package/package.json +1 -1
  47. package/pn-market-web-components/p-3ae134bf.system.entry.js +1 -0
  48. package/pn-market-web-components/{p-d0e7e65c.system.js → p-43bb8707.system.js} +1 -1
  49. package/pn-market-web-components/p-4b4ee8d5.system.entry.js +1 -0
  50. package/pn-market-web-components/p-57a1db89.system.entry.js +1 -0
  51. package/pn-market-web-components/p-62700d6e.system.js +1 -1
  52. package/pn-market-web-components/{p-f37be6ee.system.entry.js → p-80fd4dd9.system.entry.js} +1 -1
  53. package/pn-market-web-components/p-926fc962.js +1 -0
  54. package/pn-market-web-components/p-a04d0ba4.entry.js +1 -0
  55. package/pn-market-web-components/{p-64a6c2fb.js → p-af861bb5.js} +1 -1
  56. package/pn-market-web-components/p-b129cc27.system.js +1 -0
  57. package/pn-market-web-components/p-b4904bdb.system.entry.js +1 -0
  58. package/pn-market-web-components/p-ba704cbf.entry.js +1 -0
  59. package/pn-market-web-components/p-ba8e9dfe.entry.js +1 -0
  60. package/pn-market-web-components/{p-dc5ff15f.entry.js → p-d3590589.entry.js} +1 -1
  61. package/pn-market-web-components/p-e377410f.entry.js +1 -0
  62. package/pn-market-web-components/pn-market-web-components.esm.js +1 -1
  63. package/types/components/widgets/pn-find-service-and-price/pn-find-service-and-price-store.d.ts +4 -0
  64. package/types/components/widgets/pn-find-service-and-price/pn-find-service-and-price-translations.d.ts +10 -0
  65. package/types/components/widgets/pn-find-service-and-price/pn-find-service-and-price-types.d.ts +2 -0
  66. package/types/components/widgets/pn-product-pricelist/pn-product-pricelist-result.d.ts +2 -0
  67. package/types/components/widgets/pn-product-pricelist/pn-product-pricelist-store.d.ts +8 -0
  68. package/types/components/widgets/pn-product-pricelist/pn-product-pricelist-translations.d.ts +20 -0
  69. package/types/components/widgets/pn-product-pricelist/pn-product-pricelist-types.d.ts +9 -0
  70. package/types/components/widgets/pn-product-pricelist/pn-product-pricelist.d.ts +4 -0
  71. package/esm-es5/pn-product-pricelist-store-82211c4a.js +0 -1
  72. package/pn-market-web-components/p-1905c548.entry.js +0 -1
  73. package/pn-market-web-components/p-1fe6de09.entry.js +0 -1
  74. package/pn-market-web-components/p-23743bec.system.entry.js +0 -1
  75. package/pn-market-web-components/p-23d34c82.system.entry.js +0 -1
  76. package/pn-market-web-components/p-2fa246f1.system.js +0 -1
  77. package/pn-market-web-components/p-44f74289.system.entry.js +0 -1
  78. package/pn-market-web-components/p-4f283190.js +0 -1
  79. package/pn-market-web-components/p-c06b37c7.entry.js +0 -1
  80. package/pn-market-web-components/p-c9af6ced.entry.js +0 -1
  81. package/pn-market-web-components/p-ea9afb95.system.entry.js +0 -1
@@ -43,6 +43,8 @@ const translations$5 = {
43
43
  'weightlabel': 'Vikt',
44
44
  'maxweightlabel': 'Maxvikt',
45
45
  'maxmeasurementlabel': 'Maxvolym',
46
+ 'senddirectcta': 'Köp frakt via Skicka Direkt',
47
+ 'stampshopcta': 'Köp frimärken via vår webshop',
46
48
  },
47
49
  'en': {
48
50
  'componentheading': 'What do you want to send?',
@@ -52,6 +54,8 @@ const translations$5 = {
52
54
  'weightlabel': 'Weight',
53
55
  'maxweightlabel': 'Max weight',
54
56
  'maxmeasurementlabel': 'Maximum measurement',
57
+ 'senddirectcta': 'Buy shipping in Send Direct',
58
+ 'stampshopcta': 'Order home stamps from the webshop',
55
59
  },
56
60
  'da': {
57
61
  'componentheading': 'Vad vill du skicka?',
@@ -61,6 +65,8 @@ const translations$5 = {
61
65
  'weightlabel': 'Vægt',
62
66
  'maxweightlabel': 'Max vægt',
63
67
  'maxmeasurementlabel': 'Maks. Volumen',
68
+ 'senddirectcta': 'Buy shipping in Send Direct',
69
+ 'stampshopcta': 'Order home stamps from the webshop',
64
70
  },
65
71
  'no': {
66
72
  'componentheading': 'Vad vill du skicka?',
@@ -70,6 +76,8 @@ const translations$5 = {
70
76
  'weightlabel': 'Vekt',
71
77
  'maxweightlabel': 'Maks vekt',
72
78
  'maxmeasurementlabel': 'Maks volum',
79
+ 'senddirectcta': 'Buy shipping in Send Direct',
80
+ 'stampshopcta': 'Order home stamps from the webshop',
73
81
  },
74
82
  'fi': {
75
83
  'componentheading': 'Vad vill du skicka?',
@@ -79,6 +87,8 @@ const translations$5 = {
79
87
  'weightlabel': 'Paino',
80
88
  'maxweightlabel': 'Max paino',
81
89
  'maxmeasurementlabel': 'Max äänenvoimakkuus',
90
+ 'senddirectcta': 'Buy shipping in Send Direct',
91
+ 'stampshopcta': 'Order home stamps from the webshop',
82
92
  }
83
93
  };
84
94
  const markets$1 = {
@@ -114,7 +124,7 @@ const deliveryscopes = {
114
124
  ]
115
125
  };
116
126
 
117
- const weights = {
127
+ const weights$1 = {
118
128
  "letter": [
119
129
  { name: "50g", abbreviation: 'g', value: 50 },
120
130
  { name: "100g", abbreviation: 'g', value: 100 },
@@ -2058,14 +2068,16 @@ const { state: state$2, onChange: onChange$2 } = createStore({
2058
2068
  resultlistheading: '',
2059
2069
  weightlabel: '',
2060
2070
  maxweightlabel: '',
2061
- maxmeasurementlabel: ''
2071
+ maxmeasurementlabel: '',
2072
+ senddirectcta: '',
2073
+ stampshopcta: '',
2062
2074
  },
2063
2075
  market: {
2064
2076
  currency: ""
2065
2077
  }
2066
2078
  });
2067
2079
 
2068
- const pnFindServiceAndPriceCss = "pn-find-service-and-price h2,pn-find-service-and-price .heading{text-align:center;font-size:1.5em;line-height:1.1;font-weight:bold;margin-bottom:1rem}pn-find-service-and-price .postagetypes,pn-find-service-and-price .deliveryscope{text-align:center;margin-bottom:3rem}pn-find-service-and-price .weightoption{display:-ms-flexbox;display:flex;gap:1em}pn-find-service-and-price .weightoption-input{width:5em;position:relative}pn-find-service-and-price .weightoption-input input::-webkit-outer-spin-button,pn-find-service-and-price .weightoption-input input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}pn-find-service-and-price .weightoption-input-abbreviation{position:absolute;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);right:1.2em;margin-top:0.75em;font-weight:500}pn-find-service-and-price .weightoption-range{-ms-flex-positive:1;flex-grow:1;-ms-flex-item-align:end;align-self:flex-end;position:relative;top:0.5em}pn-find-service-and-price .weightoption-range input{width:calc(100% - 1.5em)}pn-find-service-and-price .weightoption-range datalist{width:100%;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;font-size:0.75em}pn-find-service-and-price .resultlist{margin:3em 0}";
2080
+ const pnFindServiceAndPriceCss = "pn-find-service-and-price .findprice-form{max-width:50em;margin:0 auto}pn-find-service-and-price h2,pn-find-service-and-price .heading{text-align:center;font-size:1.5em;line-height:1.1;font-weight:bold;margin-bottom:1rem}pn-find-service-and-price .postagetypes,pn-find-service-and-price .deliveryscope{text-align:center;margin-bottom:3rem}pn-find-service-and-price .weightoption{display:-ms-flexbox;display:flex;gap:1em}pn-find-service-and-price .weightoption-input{width:5em;position:relative}pn-find-service-and-price .weightoption-input input::-webkit-outer-spin-button,pn-find-service-and-price .weightoption-input input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}pn-find-service-and-price .weightoption-input-abbreviation{position:absolute;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);right:1.2em;margin-top:1.55rem;font-weight:500}pn-find-service-and-price .weightoption-range{-ms-flex-positive:1;flex-grow:1;-ms-flex-item-align:end;align-self:flex-end;position:relative;top:0.5em}pn-find-service-and-price .weightoption-range input{width:calc(100% - 1.5em)}pn-find-service-and-price .weightoption-range datalist{width:100%;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;font-size:0.75em}pn-find-service-and-price .resultlist{margin:3em 0}";
2069
2081
 
2070
2082
  const PnfindServiceAndPrice = class extends HTMLElement {
2071
2083
  constructor() {
@@ -2084,20 +2096,21 @@ const PnfindServiceAndPrice = class extends HTMLElement {
2084
2096
  componentWillLoad() {
2085
2097
  this.setState();
2086
2098
  this.getDataSource();
2087
- window.setTimeout(() => {
2088
- this.postagetype = postagetypes[1];
2089
- this.deliveryscope = deliveryscopes[this.postagetype.value][0];
2090
- this.weight = weights[this.postagetype.value][0];
2091
- this.weightvalue = this.weight.value;
2092
- }, 500);
2093
- // this.filterItems();
2099
+ // window.setTimeout(() => {
2100
+ // this.postagetype = postagetypes[0];
2101
+ // this.deliveryscope = deliveryscopes[this.postagetype.value][0];
2102
+ // this.weight = weights[this.postagetype.value][0];
2103
+ // this.weightvalue = this.weight.value;
2104
+ // }, 500)
2094
2105
  }
2095
2106
  async getDataSource() {
2096
- const req = await fetch(this.source);
2107
+ const cacheBusting = `?cache=${Math.floor(Math.random() * (10000 - 1) + 1)}`;
2108
+ const req = await fetch(this.source + cacheBusting);
2097
2109
  const reqbody = await req.blob();
2098
2110
  try {
2099
2111
  const convertedData = await convertFileFromStream(reqbody);
2100
2112
  this.sourceData = convertedData;
2113
+ this.filterItems();
2101
2114
  }
2102
2115
  catch (e) {
2103
2116
  console.log('Unable to parse data');
@@ -2131,32 +2144,38 @@ const PnfindServiceAndPrice = class extends HTMLElement {
2131
2144
  }
2132
2145
  // For letters we use grams. Otherwise we use KG
2133
2146
  const comparisonWeight = (this.weight.abbreviation.toLocaleLowerCase() === "kg" && this.postagetype.value === 'letter') ? this.weight.value * 1000 : this.weight.value;
2134
- let weightData = deliveryScopeData.filter(x => x.maxweight === comparisonWeight);
2147
+ let weightFilteredData = deliveryScopeData.filter(x => x.maxweight === comparisonWeight);
2135
2148
  // In parcels the maxwidths don't necessarily start at 1kg so we fetch any type below the user selected value
2136
- if (weightData.length === 0) {
2137
- weightData = deliveryScopeData.filter(x => x.maxweight >= comparisonWeight);
2138
- if (weightData.length > 0) {
2149
+ if (weightFilteredData.length === 0) {
2150
+ weightFilteredData = deliveryScopeData.filter(x => x.maxweight >= comparisonWeight);
2151
+ if (weightFilteredData.length > 0) {
2139
2152
  // We reverse the result array since the map will take the last unique item instead of the first
2140
- const uniqueWeightOptions = [...new Map(weightData.reverse().map(item => [item["id"], item])).values()];
2153
+ const uniqueWeightOptions = [...new Map(weightFilteredData.reverse().map(item => [item["id"], item])).values()];
2141
2154
  if (uniqueWeightOptions.length > 0) {
2142
- weightData = uniqueWeightOptions;
2155
+ weightFilteredData = uniqueWeightOptions;
2143
2156
  }
2144
2157
  }
2145
2158
  }
2146
- this.filteredItems = weightData;
2159
+ console.log('weightFilteredData', weightFilteredData);
2160
+ this.filteredItems = weightFilteredData;
2147
2161
  }
2148
2162
  render() {
2149
- return (h("div", null, h("div", { class: "form" }, (state$2.i18n.componentheading) ? (h("h2", null, state$2.i18n.componentheading)) : null, h("div", { class: "postagetypes" }, postagetypes.map((postagetype) => (h("pn-choice-button", { choiceid: postagetype.value, value: postagetype.value, name: "postagetype", type: "radio", checked: postagetype.value === this.postagetype.value, onChange: () => {
2163
+ return (h("div", null, h("div", { class: "findprice-form" }, (state$2.i18n.componentheading) ? (h("h2", null, state$2.i18n.componentheading)) : null, h("div", { class: "postagetypes" }, postagetypes.map((postagetype) => (h("pn-choice-button", { choiceid: postagetype.value, value: postagetype.value, name: "postagetype", type: "radio", checked: postagetype.value === this.postagetype.value, onChange: () => {
2150
2164
  this.postagetype = postagetypes.filter(x => x.value === postagetype.value)[0];
2151
- this.weight = weights[this.postagetype.value][0];
2165
+ this.deliveryscope = { value: "", name: "", icon: "" };
2166
+ this.weight = { value: 0, name: "" };
2152
2167
  this.weightvalue = this.weight.value;
2153
2168
  } }, h("pn-illustration", { illustration: postagetype.illustration }), " ", postagetype.name)))), this.postagetype.value && deliveryscopes[this.postagetype.value] ? (h("div", null, (state$2.i18n.deliveryscopeheading) ? (h("div", { class: "heading" }, state$2.i18n.deliveryscopeheading)) : null, h("div", { class: "deliveryscope" }, deliveryscopes[this.postagetype.value].map((deliveryscope) => (h("pn-choice-button", { choiceid: this.postagetype.value + deliveryscope.value, value: deliveryscope.value, name: "deliveryscope", type: "radio", checked: deliveryscope.value === this.deliveryscope.value, onChange: () => {
2154
2169
  this.deliveryscope = deliveryscopes[this.postagetype.value].filter(x => x.value === deliveryscope.value)[0];
2155
- } }, h("pn-illustration", { illustration: deliveryscope.illustration }), " ", deliveryscope.name)))))) : null, (this.postagetype.value && weights[this.postagetype.value] && this.deliveryscope.value) ? (h("div", null, (state$2.i18n.sizeheading) ? (h("div", { class: "heading" }, state$2.i18n.sizeheading)) : null, h("div", { class: "weightoption" }, h("div", { class: "weightoption-input" }, h("pn-input", { inputid: "weightvalue", name: "weightvalue", type: "number", label: state$2.i18n.weightlabel, value: this.weightvalue, onChange: (e) => {
2170
+ if (this.weight.value === 0) {
2171
+ this.weight = weights$1[this.postagetype.value][0];
2172
+ this.weightvalue = this.weight.value;
2173
+ }
2174
+ } }, h("pn-illustration", { illustration: deliveryscope.illustration }), " ", deliveryscope.name)))))) : null, (this.postagetype.value && weights$1[this.postagetype.value] && this.deliveryscope.value) ? (h("div", null, (state$2.i18n.sizeheading) ? (h("div", { class: "heading" }, state$2.i18n.sizeheading)) : null, h("div", { class: "weightoption" }, h("div", { class: "weightoption-input" }, h("pn-input", { inputid: "weightvalue", name: "weightvalue", type: "number", label: state$2.i18n.weightlabel, value: this.weightvalue, onChange: (e) => {
2156
2175
  if (e && e.target && e.target.value) {
2157
2176
  const weightNum = parseInt(e.target.value, 10);
2158
2177
  if (!isNaN(weightNum)) {
2159
- let matchingWeights = weights[this.postagetype.value].filter((x) => {
2178
+ let matchingWeights = weights$1[this.postagetype.value].filter((x) => {
2160
2179
  let weightInGrams = (x.abbreviation === "kg") ? x.value * 1000 : x.value;
2161
2180
  return weightInGrams >= weightNum;
2162
2181
  });
@@ -2166,19 +2185,19 @@ const PnfindServiceAndPrice = class extends HTMLElement {
2166
2185
  }
2167
2186
  }
2168
2187
  }
2169
- } }), h("span", { class: "weightoption-input-abbreviation" }, this.weight.abbreviation)), h("div", { class: "weightoption-range" }, h("input", { type: "range", id: "weightrange", name: "weightrange", list: "weightlist", value: (!this.weight.value) ? 0 : weights[this.postagetype.value].findIndex((x) => x.value === this.weightvalue), onChange: (e) => {
2188
+ } }), h("span", { class: "weightoption-input-abbreviation" }, this.weight.abbreviation)), h("div", { class: "weightoption-range" }, h("input", { type: "range", id: "weightrange", name: "weightrange", list: "weightlist", value: (!this.weight.value) ? 0 : weights$1[this.postagetype.value].findIndex((x) => x.value === this.weightvalue), onChange: (e) => {
2170
2189
  const value = e.target.value;
2171
- this.weight = weights[this.postagetype.value][value];
2190
+ this.weight = weights$1[this.postagetype.value][value];
2172
2191
  this.weightvalue = this.weight.value;
2173
2192
  }, min: "0",
2174
2193
  // max={ weights[this.postagetype.value][weights[this.postagetype.value].length - 1].value }
2175
- max: weights[this.postagetype.value].length - 1 }), h("datalist", { id: "weightlist" }, weights[this.postagetype.value].map((weight, weightindex) => {
2194
+ max: weights$1[this.postagetype.value].length - 1 }), h("datalist", { id: "weightlist" }, weights$1[this.postagetype.value].map((weight, weightindex) => {
2176
2195
  let labelText = weight.name;
2177
- if (weights[this.postagetype.value].length > 6) {
2178
- labelText = (weightindex % 5 === 0 || weightindex === 0 || weightindex === weights[this.postagetype.value].length - 1) ? weight.name : '';
2196
+ if (weights$1[this.postagetype.value].length > 6) {
2197
+ labelText = (weightindex % 5 === 0 || weightindex === 0 || weightindex === weights$1[this.postagetype.value].length - 1) ? weight.name : '';
2179
2198
  }
2180
2199
  return (h("option", Object.assign({ value: weightindex }, (labelText ? { label: labelText } : {}))));
2181
- })))))) : null), (this.filteredItems) ? (h("div", { class: "resultlist" }, (state$2.i18n.resultlistheading) ? (h("div", { class: "heading" }, state$2.i18n.resultlistheading)) : null, this.filteredItems.map((item) => (h("div", null, h("pn-find-service-and-price-result", { item: item })))))) : null));
2200
+ })))))) : null), (this.filteredItems && this.filteredItems.length > 0) ? (h("div", { class: "resultlist" }, (state$2.i18n.resultlistheading) ? (h("div", { class: "heading" }, state$2.i18n.resultlistheading)) : null, this.filteredItems.map((item) => (h("div", null, h("pn-find-service-and-price-result", { item: item })))))) : null));
2182
2201
  }
2183
2202
  static get watchers() { return {
2184
2203
  "market": ["setState"],
@@ -2219,7 +2238,7 @@ const PnfindServiceAndPriceResult = class extends HTMLElement {
2219
2238
  (this.item.what === "letter" && this.item.maxweight > 999) ? Math.round(this.item.maxweight / 1000) + " kg" : this.item.maxweight + " g";
2220
2239
  }
2221
2240
  render() {
2222
- return (h(Host, null, this.shownitems.map((item) => (h("pn-product-tile", null, h("pn-illustration", { slot: "illustration", illustration: item.illustration }), h("div", { slot: "content" }, h("div", { class: "content" }, h("h3", null, item.name), (item.description) ? (h("div", { class: "description" }, item.description)) : null, (item.info) ? (h("div", { class: "description" }, item.info)) : null)), item.maxweight ? (h("pn-product-tile-info", { label: state$2.i18n.maxweightlabel, text: this.weightText })) : null, item.maximummeasurements ? (h("pn-product-tile-info", { label: state$2.i18n.maxmeasurementlabel, text: item.maximummeasurements })) : null, item.pricestamps ? (h("pn-product-tile-price", { slot: "price", label: "With stamps", amount: item.pricestamps + '', currency: state$2.market.currency })) : null, item.priceagent ? (h("pn-product-tile-price", { slot: "price", label: "Service point", amount: item.priceagent + '', currency: state$2.market.currency, url: "https://shop.postnord.se/ebutik/default.aspx" })) : null, item.pricesenddirect ? (h("pn-product-tile-price", { slot: "price", label: "Send direct", amount: item.pricesenddirect + '', currency: state$2.market.currency, url: "https://portal.postnord.com/skickadirekt/" })) : null, item.info ? (h("small", { slot: "note" }, h("p", null, item.note))) : null)))));
2241
+ return (h(Host, null, this.shownitems.map((item) => (h("pn-product-tile", null, h("pn-illustration", { slot: "illustration", illustration: item.illustration }), h("div", { slot: "content" }, h("div", { class: "content" }, h("h3", null, item.name), (item.description) ? (h("div", { class: "description" }, item.description)) : null, (item.info) ? (h("div", { class: "description" }, item.info)) : null)), item.maxweight ? (h("pn-product-tile-info", { label: state$2.i18n.maxweightlabel, text: this.weightText })) : null, item.maximummeasurements ? (h("pn-product-tile-info", { label: state$2.i18n.maxmeasurementlabel, text: item.maximummeasurements })) : null, item.pricestamps ? (h("pn-product-tile-price", { slot: "price", label: state$2.i18n.stampshopcta, amount: item.pricestamps + '', currency: state$2.market.currency })) : null, item.priceagent ? (h("pn-product-tile-price", { slot: "price", label: "", amount: item.priceagent + '', currency: state$2.market.currency, url: "https://shop.postnord.se/ebutik/default.aspx" })) : null, item.pricesenddirect ? (h("pn-product-tile-price", { slot: "price", label: state$2.i18n.senddirectcta, amount: item.pricesenddirect + '', currency: state$2.market.currency, url: "https://portal.postnord.com/skickadirekt/" })) : null, item.note ? (h("small", { slot: "note" }, h("p", null, item.note))) : null)))));
2223
2242
  }
2224
2243
  static get watchers() { return {
2225
2244
  "item": ["composeItems"]
@@ -3178,23 +3197,43 @@ const PnMarketwebSiteheaderSearch$1 = class extends HTMLElement {
3178
3197
  const translations = {
3179
3198
  'sv': {
3180
3199
  'maxweightlabel': 'Maxvikt',
3200
+ 'weightlabel': 'Vikt',
3181
3201
  'maxmeasurementlabel': 'Maxvolym',
3202
+ 'sizeheading': 'Hur mycket väger det?',
3203
+ 'senddirectcta': 'Köp frakt via Skicka Direkt',
3204
+ 'stampshopcta': 'Köp frimärken via vår webshop',
3182
3205
  },
3183
3206
  'en': {
3184
3207
  'maxweightlabel': 'Max weight',
3208
+ 'weightlabel': 'Weight',
3185
3209
  'maxmeasurementlabel': 'Maximum measurement',
3210
+ 'sizeheading': 'How much does it weigh?',
3211
+ 'senddirectcta': 'Buy shipping in Send Direct',
3212
+ 'stampshopcta': 'Order home stamps from the webshop',
3186
3213
  },
3187
3214
  'da': {
3188
3215
  'maxweightlabel': 'Max vægt',
3216
+ 'weightlabel': 'Vægt',
3189
3217
  'maxmeasurementlabel': 'Maks. Volumen',
3218
+ 'sizeheading': 'How much does it weigh?',
3219
+ 'senddirectcta': 'Buy shipping in Send Direct',
3220
+ 'stampshopcta': 'Order home stamps from the webshop',
3190
3221
  },
3191
3222
  'no': {
3192
3223
  'maxweightlabel': 'Maks vekt',
3224
+ 'weightlabel': 'Vekt',
3193
3225
  'maxmeasurementlabel': 'Maks volum',
3226
+ 'sizeheading': 'How much does it weigh?',
3227
+ 'senddirectcta': 'Buy shipping in Send Direct',
3228
+ 'stampshopcta': 'Order home stamps from the webshop',
3194
3229
  },
3195
3230
  'fi': {
3196
3231
  'maxweightlabel': 'Max paino',
3232
+ 'weightlabel': 'Piano',
3197
3233
  'maxmeasurementlabel': 'Max äänenvoimakkuus',
3234
+ 'sizeheading': 'How much does it weigh?',
3235
+ 'senddirectcta': 'Buy shipping in Send Direct',
3236
+ 'stampshopcta': 'Order home stamps from the webshop',
3198
3237
  }
3199
3238
  };
3200
3239
  const markets = {
@@ -3212,18 +3251,54 @@ const markets = {
3212
3251
  }
3213
3252
  };
3214
3253
 
3254
+ const weights = {
3255
+ "letter": [
3256
+ { name: "50g", abbreviation: 'g', value: 50 },
3257
+ { name: "100g", abbreviation: 'g', value: 100 },
3258
+ { name: "250g", abbreviation: 'g', value: 250 },
3259
+ { name: "500g", abbreviation: 'g', value: 500 },
3260
+ { name: "1kg", abbreviation: 'kg', value: 1 },
3261
+ { name: "2kg", abbreviation: 'kg', value: 2 },
3262
+ ],
3263
+ "parcel": [
3264
+ { name: "1kg", abbreviation: 'kg', value: 1 },
3265
+ { name: "2kg", abbreviation: 'kg', value: 2 },
3266
+ { name: "3kg", abbreviation: 'kg', value: 3 },
3267
+ { name: "4kg", abbreviation: 'kg', value: 4 },
3268
+ { name: "5kg", abbreviation: 'kg', value: 5 },
3269
+ { name: "6kg", abbreviation: 'kg', value: 6 },
3270
+ { name: "7Kg", abbreviation: 'kg', value: 7 },
3271
+ { name: "8kg", abbreviation: 'kg', value: 8 },
3272
+ { name: "9kg", abbreviation: 'kg', value: 9 },
3273
+ { name: "10kg", abbreviation: 'kg', value: 10 },
3274
+ { name: "11kg", abbreviation: 'kg', value: 11 },
3275
+ { name: "12kg", abbreviation: 'kg', value: 12 },
3276
+ { name: "13kg", abbreviation: 'kg', value: 13 },
3277
+ { name: "14kg", abbreviation: 'kg', value: 14 },
3278
+ { name: "15kg", abbreviation: 'kg', value: 15 },
3279
+ { name: "16kg", abbreviation: 'kg', value: 16 },
3280
+ { name: "17kg", abbreviation: 'kg', value: 17 },
3281
+ { name: "18kg", abbreviation: 'kg', value: 18 },
3282
+ { name: "20kg", abbreviation: 'kg', value: 20 },
3283
+ ]
3284
+ };
3285
+
3215
3286
  // Read more about how stencil stores work here: https://stenciljs.com/docs/stencil-store
3216
3287
  const { state, onChange } = createStore({
3217
3288
  i18n: {
3218
3289
  maxweightlabel: '',
3219
- maxmeasurementlabel: ''
3290
+ weightlabel: '',
3291
+ maxmeasurementlabel: '',
3292
+ sizeheading: '',
3293
+ senddirectcta: '',
3294
+ stampshopcta: '',
3220
3295
  },
3221
3296
  market: {
3222
3297
  currency: ""
3223
3298
  }
3224
3299
  });
3225
3300
 
3226
- const pnProductPricelistCss = "pn-product-pricelist pn-spinner{margin:1em auto}pn-product-pricelist .resultlist:not([data-list-count=\"0\"]){margin-top:1.5em}";
3301
+ const pnProductPricelistCss = "pn-product-pricelist pn-spinner{margin:1em auto}pn-product-pricelist h2,pn-product-pricelist .heading{text-align:center;font-size:1.5em;line-height:1.1;font-weight:bold;margin-bottom:1rem}pn-product-pricelist .content,pn-product-pricelist .weightselection{max-width:50em;margin:0 auto 1em}pn-product-pricelist .weightoption{display:-ms-flexbox;display:flex;gap:1em}pn-product-pricelist .weightoption-input{width:5em;position:relative}pn-product-pricelist .weightoption-input input::-webkit-outer-spin-button,pn-product-pricelist .weightoption-input input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}pn-product-pricelist .weightoption-input-abbreviation{position:absolute;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);right:1.2em;margin-top:1.55rem;font-weight:500}pn-product-pricelist .weightoption-range{-ms-flex-positive:1;flex-grow:1;-ms-flex-item-align:end;align-self:flex-end;position:relative;top:0.5em}pn-product-pricelist .weightoption-range input{width:calc(100% - 1.5em)}pn-product-pricelist .weightoption-range datalist{width:100%;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;font-size:0.75em}pn-product-pricelist .resultlist:not([data-list-count=\"0\"]){margin-top:2em}";
3227
3302
 
3228
3303
  const PnFindProductPricelist = class extends HTMLElement {
3229
3304
  constructor() {
@@ -3237,6 +3312,9 @@ const PnFindProductPricelist = class extends HTMLElement {
3237
3312
  this.sourceData = { types: [], data: [] };
3238
3313
  this.gotData = false;
3239
3314
  this.loading = false;
3315
+ this.postagetype = { value: "" };
3316
+ this.weight = { value: 0, name: "" };
3317
+ this.weightvalue = 0;
3240
3318
  }
3241
3319
  componentWillLoad() {
3242
3320
  this.setState();
@@ -3274,15 +3352,69 @@ const PnFindProductPricelist = class extends HTMLElement {
3274
3352
  return;
3275
3353
  }
3276
3354
  this.loading = false;
3277
- this.filteredItems = this.sourceData.data.filter(x => x.id === this.productid);
3355
+ const productIdItems = this.sourceData.data.filter(x => x.id === this.productid);
3356
+ if (productIdItems.length === 0) {
3357
+ return;
3358
+ }
3359
+ this.postagetype.value = productIdItems[0].what;
3360
+ if (!weights[this.postagetype.value] || weights[this.postagetype.value].length === 0) {
3361
+ return;
3362
+ }
3363
+ if (this.weightvalue === 0) {
3364
+ this.weight = weights[this.postagetype.value][0];
3365
+ this.weightvalue = this.weight.value;
3366
+ }
3367
+ // For letters we use grams. Otherwise we use KG
3368
+ const comparisonWeight = (this.weight.abbreviation.toLocaleLowerCase() === "kg" && this.postagetype.value === 'letter') ? this.weight.value * 1000 : this.weight.value;
3369
+ let weightFilteredData = productIdItems.filter(x => x.maxweight === comparisonWeight);
3370
+ // In parcels the maxwidths don't necessarily start at 1kg so we fetch any type below the user selected value
3371
+ if (weightFilteredData.length === 0) {
3372
+ weightFilteredData = productIdItems.filter(x => x.maxweight >= comparisonWeight);
3373
+ if (weightFilteredData.length > 0) {
3374
+ // We reverse the result array since the map will take the last unique item instead of the first
3375
+ const uniqueWeightOptions = [...new Map(weightFilteredData.reverse().map(item => [item["id"], item])).values()];
3376
+ if (uniqueWeightOptions.length > 0) {
3377
+ weightFilteredData = uniqueWeightOptions;
3378
+ }
3379
+ }
3380
+ }
3381
+ this.filteredItems = weightFilteredData;
3278
3382
  this.gotData = this.filteredItems.length > 0;
3279
3383
  }
3280
3384
  render() {
3281
- return (h(Host, null, h("div", { class: "content" }, h("slot", null)), this.loading ? (h("pn-spinner", null)) : null, h("div", { class: "resultlist", "data-list-count": this.filteredItems.length }, this.filteredItems.map((item) => (h("div", null, h("pn-product-pricelist-result", { item: item })))))));
3385
+ return (h(Host, null, h("div", { class: "content" }, h("slot", null)), this.loading ? (h("pn-spinner", null)) : null, (this.postagetype.value && weights[this.postagetype.value]) ? (h("div", { class: "weightselection" }, (state.i18n.sizeheading) ? (h("div", { class: "heading" }, state.i18n.sizeheading)) : null, h("div", { class: "weightoption" }, h("div", { class: "weightoption-input" }, h("pn-input", { inputid: "weightvalue", name: "weightvalue", type: "number", label: state.i18n.weightlabel, value: this.weightvalue, onChange: (e) => {
3386
+ if (e && e.target && e.target.value) {
3387
+ const weightNum = parseInt(e.target.value, 10);
3388
+ if (!isNaN(weightNum)) {
3389
+ let matchingWeights = weights[this.postagetype.value].filter((x) => {
3390
+ let weightInGrams = (x.abbreviation === "kg") ? x.value * 1000 : x.value;
3391
+ return weightInGrams >= weightNum;
3392
+ });
3393
+ if (matchingWeights && matchingWeights.length > 0) {
3394
+ this.weight = matchingWeights[0];
3395
+ this.weightvalue = this.weight.value;
3396
+ }
3397
+ }
3398
+ }
3399
+ } }), h("span", { class: "weightoption-input-abbreviation" }, this.weight.abbreviation)), h("div", { class: "weightoption-range" }, h("input", { type: "range", id: "weightrange", name: "weightrange", list: "weightlist", value: (!this.weight.value) ? 0 : weights[this.postagetype.value].findIndex((x) => x.value === this.weightvalue), onChange: (e) => {
3400
+ const value = e.target.value;
3401
+ this.weight = weights[this.postagetype.value][value];
3402
+ this.weightvalue = this.weight.value;
3403
+ }, min: "0",
3404
+ // max={ weights[this.postagetype.value][weights[this.postagetype.value].length - 1].value }
3405
+ max: weights[this.postagetype.value].length - 1 }), h("datalist", { id: "weightlist" }, weights[this.postagetype.value].map((weight, weightindex) => {
3406
+ let labelText = weight.name;
3407
+ if (weights[this.postagetype.value].length > 6) {
3408
+ labelText = (weightindex % 5 === 0 || weightindex === 0 || weightindex === weights[this.postagetype.value].length - 1) ? weight.name : '';
3409
+ }
3410
+ return (h("option", Object.assign({ value: weightindex }, (labelText ? { label: labelText } : {}))));
3411
+ })))))) : null, h("div", { class: "resultlist", "data-list-count": this.filteredItems.length }, this.filteredItems.map((item) => (h("div", null, h("pn-product-pricelist-result", { item: item })))))));
3282
3412
  }
3283
3413
  static get watchers() { return {
3284
3414
  "market": ["setState"],
3285
- "language": ["setState"]
3415
+ "language": ["setState"],
3416
+ "postagetype": ["filterItems"],
3417
+ "weightvalue": ["filterItems"]
3286
3418
  }; }
3287
3419
  static get style() { return pnProductPricelistCss; }
3288
3420
  };
@@ -3295,8 +3427,13 @@ const PnFindProductPricelistResult = class extends HTMLElement {
3295
3427
  this.__registerHost();
3296
3428
  this.item = null;
3297
3429
  this.shownitems = [];
3430
+ this.weightText = "";
3298
3431
  }
3299
3432
  componentWillLoad() {
3433
+ this.composeItems();
3434
+ }
3435
+ composeItems() {
3436
+ this.shownitems = [];
3300
3437
  if (this.item.pricestamps) {
3301
3438
  this.shownitems.push(Object.assign(Object.assign({}, this.item), { priceagent: null, pricesenddirect: null }));
3302
3439
  }
@@ -3306,14 +3443,20 @@ const PnFindProductPricelistResult = class extends HTMLElement {
3306
3443
  if (this.item.pricesenddirect) {
3307
3444
  this.shownitems.push(Object.assign(Object.assign({}, this.item), { pricestamps: null, priceagent: null }));
3308
3445
  }
3446
+ // Parcels are always in KG. Letter KG must be converted from grams
3447
+ this.weightText = (this.item.what === "parcel") ? this.item.maxweight + 'kg' :
3448
+ (this.item.what === "letter" && this.item.maxweight > 999) ? Math.round(this.item.maxweight / 1000) + " kg" : this.item.maxweight + " g";
3309
3449
  }
3310
3450
  render() {
3311
- return (h(Host, null, this.shownitems.map((item) => (h("pn-product-tile", null, h("pn-illustration", { slot: "illustration", illustration: item.illustration }), h("div", { slot: "content" }, h("div", { class: "content" }, h("h3", null, item.name), (item.description) ? (h("div", { class: "description" }, item.description)) : null, (item.info) ? (h("div", { class: "description" }, item.info)) : null)), item.maxweight ? (h("pn-product-tile-info", { label: state.i18n.maxweightlabel, text: item.maxweight + '' })) : null, item.maximummeasurements ? (h("pn-product-tile-info", { label: state.i18n.maxmeasurementlabel, text: item.maximummeasurements })) : null, item.pricestamps ? (h("pn-product-tile-price", { slot: "price", label: "With stamps", amount: item.pricestamps + '', currency: state.market.currency })) : null, item.priceagent ? (h("pn-product-tile-price", { slot: "price", label: "Service point", amount: item.priceagent + '', currency: state.market.currency, url: "https://shop.postnord.se/ebutik/default.aspx" })) : null, item.pricesenddirect ? (h("pn-product-tile-price", { slot: "price", label: "Send direct", amount: item.pricesenddirect + '', currency: state.market.currency, url: "https://portal.postnord.com/skickadirekt/" })) : null, item.info ? (h("small", { slot: "note" }, h("p", null, item.note))) : null)))));
3451
+ return (h(Host, null, this.shownitems.map((item) => (h("pn-product-tile", null, h("pn-illustration", { slot: "illustration", illustration: item.illustration }), h("div", { slot: "content" }, h("div", { class: "content" }, h("h3", null, item.name), (item.description) ? (h("div", { class: "description" }, item.description)) : null, (item.info) ? (h("div", { class: "description" }, item.info)) : null)), item.maxweight ? (h("pn-product-tile-info", { label: state.i18n.maxweightlabel, text: this.weightText })) : null, item.maximummeasurements ? (h("pn-product-tile-info", { label: state.i18n.maxmeasurementlabel, text: item.maximummeasurements })) : null, item.pricestamps ? (h("pn-product-tile-price", { slot: "price", label: state.i18n.stampshopcta, amount: item.pricestamps + '', currency: state.market.currency })) : null, item.priceagent ? (h("pn-product-tile-price", { slot: "price", label: "", amount: item.priceagent + '', currency: state.market.currency, url: "https://shop.postnord.se/ebutik/default.aspx" })) : null, item.pricesenddirect ? (h("pn-product-tile-price", { slot: "price", label: state.i18n.senddirectcta, amount: item.pricesenddirect + '', currency: state.market.currency, url: "https://portal.postnord.com/skickadirekt/" })) : null, item.note ? (h("small", { slot: "note" }, h("p", null, item.note))) : null)))));
3312
3452
  }
3453
+ static get watchers() { return {
3454
+ "item": ["composeItems"]
3455
+ }; }
3313
3456
  static get style() { return pnProductPricelistResultCss; }
3314
3457
  };
3315
3458
 
3316
- const pnProductTileCss = "pn-product-tile{margin-bottom:1em;border:0.1rem solid #D3CECB;outline:none;background:white;-webkit-box-shadow:0px 0.6px 1.8px rgba(0, 0, 0, 0.1), 0px 3.2px 7.2px rgba(0, 0, 0, 0.13);box-shadow:0px 0.6px 1.8px rgba(0, 0, 0, 0.1), 0px 3.2px 7.2px rgba(0, 0, 0, 0.13);display:-ms-flexbox;display:flex;padding:1.5em;word-break:break-word;text-decoration:none;border-radius:0.8rem}pn-product-tile [slot=content] h3{display:-ms-flexbox;display:flex;width:100%;-ms-flex-pack:justify;justify-content:space-between;margin-bottom:0.5em}pn-product-tile>pn-illustration{min-width:8rem;width:8rem;height:8rem;margin-right:3rem;-ms-flex-item-align:center;align-self:center}pn-product-tile .tilecontent{-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:start;align-items:flex-start;-ms-flex-pack:center;justify-content:center}pn-product-tile .details{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;width:100%;-ms-flex-align:center;align-items:center}pn-product-tile .info{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-positive:1;flex-grow:1;max-width:calc((100% / 3) * 2);-ms-flex-flow:wrap;flex-flow:wrap}pn-product-tile .info>*{min-width:6em;margin:0.2em 1em 0.2em 0}";
3459
+ const pnProductTileCss = "pn-product-tile{margin-bottom:1em;border:0.1rem solid #D3CECB;outline:none;background:white;-webkit-box-shadow:0px 0.6px 1.8px rgba(0, 0, 0, 0.1), 0px 3.2px 7.2px rgba(0, 0, 0, 0.13);box-shadow:0px 0.6px 1.8px rgba(0, 0, 0, 0.1), 0px 3.2px 7.2px rgba(0, 0, 0, 0.13);display:-ms-flexbox;display:flex;padding:1.5em;word-break:break-word;text-decoration:none;border-radius:0.8rem}pn-product-tile [slot=content] h3{display:-ms-flexbox;display:flex;width:100%;-ms-flex-pack:justify;justify-content:space-between;margin-bottom:0.5em}pn-product-tile>pn-illustration{min-width:8rem;width:8rem;height:8rem;margin-right:3rem;-ms-flex-item-align:center;align-self:center}pn-product-tile .tilecontent{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:center;justify-content:center;-ms-flex-positive:1;flex-grow:1}pn-product-tile .details{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:justify;justify-content:space-between;width:100%}pn-product-tile .info{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-positive:1;flex-grow:1;max-width:calc((100% / 3) * 2);-ms-flex-flow:wrap;flex-flow:wrap}pn-product-tile .info>*{min-width:6em;margin:0.2em 1em 0.2em 0}";
3317
3460
 
3318
3461
  const PnProductTile$1 = class extends HTMLElement {
3319
3462
  constructor() {
@@ -3321,7 +3464,7 @@ const PnProductTile$1 = class extends HTMLElement {
3321
3464
  this.__registerHost();
3322
3465
  }
3323
3466
  render() {
3324
- return (h(Host, null, h("slot", { name: "illustration" }), h("div", { class: "tilecontent" }, h("slot", { name: "content" }), h("div", { class: "details" }, h("div", { class: "info" }, h("slot", null)), h("slot", { name: "price" })), h("slot", { name: "note" }))));
3467
+ return (h(Host, null, h("slot", { name: "illustration" }), h("div", { class: "tilecontent" }, h("div", { class: "details" }, h("slot", { name: "content" }), h("div", { class: "info" }, h("slot", null)), h("slot", { name: "note" })), h("slot", { name: "price" }))));
3325
3468
  }
3326
3469
  static get style() { return pnProductTileCss; }
3327
3470
  };
@@ -3340,7 +3483,7 @@ const PnProductTileInfo$1 = class extends HTMLElement {
3340
3483
  };
3341
3484
  h("pn-icon", { symbol: "align-center", small: "false", color: "black" });
3342
3485
 
3343
- const pnProductTilePriceCss = "pn-product-tile-price span:last-child{display:inline-block;margin-left:0.2em}pn-product-tile-price+pn-product-tile-price{margin-left:1.5em}pn-product-tile-price small{display:-ms-flexbox;display:flex}pn-product-tile-price pn-icon{display:inline-block;-ms-flex-item-align:center;align-self:center}pn-product-tile-price a{text-decoration:none;color:#005D92}pn-product-tile-price a h3{text-decoration:underline}";
3486
+ const pnProductTilePriceCss = "pn-product-tile-price{margin-top:1em;white-space:nowrap;text-align:right}pn-product-tile-price span:last-child{display:inline-block;margin-left:0.2em}pn-product-tile-price+pn-product-tile-price{margin-left:1.5em}pn-product-tile-price pn-icon{display:inline-block;-ms-flex-item-align:center;align-self:center}pn-product-tile-price a{text-decoration:none;color:#005D92}pn-product-tile-price a h3{text-decoration:underline}";
3344
3487
 
3345
3488
  const PnProductTilePrice$1 = class extends HTMLElement {
3346
3489
  constructor() {
@@ -3351,7 +3494,7 @@ const PnProductTilePrice$1 = class extends HTMLElement {
3351
3494
  if (!this.amount) {
3352
3495
  return;
3353
3496
  }
3354
- return (this.url) ? (h(Host, null, h("a", { href: this.url }, (this.label) ? (h("p", null, h("small", null, this.label, h("pn-icon", { symbol: "open-in-new", small: "true", color: "blue700" })))) : null, h("h3", null, (this.amount) ? (h("span", { class: "pn-2xl" }, this.amount)) : null, (this.currency) ? (h("span", null, this.currency)) : null)))) : (h(Host, null, (this.label) ? (h("p", null, h("small", null, this.label))) : null, h("h3", null, (this.amount) ? (h("span", { class: "pn-2xl" }, this.amount)) : null, (this.currency) ? (h("span", null, this.currency)) : null)));
3497
+ return (this.url) ? (h(Host, null, h("h3", null, (this.amount) ? (h("span", { class: "pn-2xl" }, this.amount)) : null, (this.currency) ? (h("span", { class: "pn-2xl" }, this.currency)) : null), (this.label) ? (h("a", { href: this.url }, h("pn-button", { small: "true", icon: "arrow-right" }, this.label))) : null)) : (h(Host, null, h("h3", null, (this.amount) ? (h("span", { class: "pn-2xl" }, this.amount)) : null, (this.currency) ? (h("span", { class: "pn-2xl" }, this.currency)) : null)));
3355
3498
  }
3356
3499
  static get style() { return pnProductTilePriceCss; }
3357
3500
  };
@@ -3467,8 +3610,8 @@ const PnMarketwebSitefooter = /*@__PURE__*/proxyCustomElement(PnMarketwebSitehea
3467
3610
  const PnMarketwebSiteheader = /*@__PURE__*/proxyCustomElement(PnMarketwebSiteheader$1, [4,"pn-marketweb-siteheader",{"market":[1],"language":[1],"endpoint":[1],"hideSiteSelector":[1028,"hide-site-selector"],"hideLanguageSelector":[1028,"hide-language-selector"],"hideSearch":[1028,"hide-search"],"hideLogin":[1028,"hide-login"],"i18n":[32],"gotData":[32],"fetchingData":[32],"menuItems":[32],"siteDefinition":[32],"search":[32],"siteSelector":[32],"languageSelector":[32],"loginDialog":[32],"minimizeSearch":[32]},[[9,"resize","handleResize"]]]);
3468
3611
  const PnMarketwebSiteheaderLogin = /*@__PURE__*/proxyCustomElement(PnMarketwebSiteheaderLogin$1, [0,"pn-marketweb-siteheader-login",{"endpoint":[1],"i18n":[8,"i-1-8n"],"loginDialog":[1040],"loginManager":[32],"loggedIn":[32],"toggleButtonText":[32]}]);
3469
3612
  const PnMarketwebSiteheaderSearch = /*@__PURE__*/proxyCustomElement(PnMarketwebSiteheaderSearch$1, [0,"pn-marketweb-siteheader-search",{"i18n":[8,"i-1-8n"],"showOnlyLink":[1028,"show-only-link"],"hideSearch":[1028,"hide-search"],"search":[1040]}]);
3470
- const PnProductPricelist = /*@__PURE__*/proxyCustomElement(PnFindProductPricelist, [4,"pn-product-pricelist",{"source":[1],"language":[1025],"market":[1025],"productid":[1],"filteredItems":[32],"sourceData":[32],"gotData":[32],"loading":[32]}]);
3471
- const PnProductPricelistResult = /*@__PURE__*/proxyCustomElement(PnFindProductPricelistResult, [0,"pn-product-pricelist-result",{"item":[16],"shownitems":[16]}]);
3613
+ const PnProductPricelist = /*@__PURE__*/proxyCustomElement(PnFindProductPricelist, [4,"pn-product-pricelist",{"source":[1],"language":[1025],"market":[1025],"productid":[1],"filteredItems":[32],"sourceData":[32],"gotData":[32],"loading":[32],"postagetype":[32],"weight":[32],"weightvalue":[32]}]);
3614
+ const PnProductPricelistResult = /*@__PURE__*/proxyCustomElement(PnFindProductPricelistResult, [0,"pn-product-pricelist-result",{"item":[1040],"shownitems":[16],"weightText":[32]}]);
3472
3615
  const PnProductTile = /*@__PURE__*/proxyCustomElement(PnProductTile$1, [4,"pn-product-tile"]);
3473
3616
  const PnProductTileInfo = /*@__PURE__*/proxyCustomElement(PnProductTileInfo$1, [0,"pn-product-tile-info",{"label":[1],"text":[1],"icon":[1]}]);
3474
3617
  const PnProductTilePrice = /*@__PURE__*/proxyCustomElement(PnProductTilePrice$1, [0,"pn-product-tile-price",{"label":[1],"amount":[1],"currency":[1],"url":[1]}]);
package/esm/loader.js CHANGED
@@ -10,7 +10,7 @@ const patchEsm = () => {
10
10
  const defineCustomElements = (win, options) => {
11
11
  if (typeof window === 'undefined') return Promise.resolve();
12
12
  return patchEsm().then(() => {
13
- return bootstrapLazy([["pn-marketweb-siteheader",[[4,"pn-marketweb-siteheader",{"market":[1],"language":[1],"endpoint":[1],"hideSiteSelector":[1028,"hide-site-selector"],"hideLanguageSelector":[1028,"hide-language-selector"],"hideSearch":[1028,"hide-search"],"hideLogin":[1028,"hide-login"],"i18n":[32],"gotData":[32],"fetchingData":[32],"menuItems":[32],"siteDefinition":[32],"search":[32],"siteSelector":[32],"languageSelector":[32],"loginDialog":[32],"minimizeSearch":[32]},[[9,"resize","handleResize"]]]]],["pn-find-service-and-price",[[0,"pn-find-service-and-price",{"source":[1],"language":[1025],"market":[1025],"filteredItems":[32],"postagetype":[32],"weight":[32],"weightvalue":[32],"deliveryscope":[32],"sourceData":[32]}]]],["pn-product-pricelist",[[4,"pn-product-pricelist",{"source":[1],"language":[1025],"market":[1025],"productid":[1],"filteredItems":[32],"sourceData":[32],"gotData":[32],"loading":[32]}]]],["pn-site-footer_2",[[4,"pn-site-footer",{"url":[1]}],[4,"pn-site-footer-col"]]],["pn-marketweb-sitefooter",[[0,"pn-marketweb-sitefooter",{"market":[1],"language":[1],"endpoint":[1],"siteDefinition":[32],"footerContent":[32],"i18n":[32],"gotData":[32],"fetchingData":[32]}]]],["pn-product-pricelist-result",[[0,"pn-product-pricelist-result",{"item":[16],"shownitems":[16]}]]],["pn-choice-button_2",[[0,"pn-find-service-and-price-result",{"item":[1040],"shownitems":[16],"weightText":[32]}],[4,"pn-choice-button",{"value":[520],"name":[1],"choiceid":[1],"type":[1],"disabled":[4],"checked":[4],"indeterminate":[1028]},[[0,"change","handlechange"]]]]],["pn-mainnav-link",[[4,"pn-mainnav-link",{"name":[1],"href":[1],"target":[1],"linkid":[1],"levelId":[32],"open":[32],"hasChildren":[32]}]]],["pn-language-selector_9",[[4,"pn-mainnav-level",{"level":[32],"levelId":[32],"isOpen":[32],"parentName":[32],"parentHref":[32],"parentLinkId":[32],"listCount":[32],"alignment":[32]}],[4,"pn-language-selector",{"value":[1537],"selectedLanguageName":[32],"options":[32],"i18n":[32]}],[0,"pn-language-selector-option",{"name":[1],"code":[1],"url":[1],"selected":[4],"currentLanguage":[1,"current-language"]}],[4,"pn-mainnav",{"market":[1],"language":[1],"navigationId":[1,"navigation-id"],"openMenu":[1028,"open-menu"]},[[0,"language","setLanguage"],[0,"market","setMarket"],[0,"menuLanguageChange","onLanguageChange"],[0,"setmenuopen","setOpenMenu"],[0,"openMenuLevelChange","onOpenMenuLevelChange"]]],[4,"pn-mainnav-list",{"heading":[1],"linkCount":[32]}],[0,"pn-marketweb-siteheader-login",{"endpoint":[1],"i18n":[8,"i-1-8n"],"loginDialog":[1040],"loginManager":[32],"loggedIn":[32],"toggleButtonText":[32]}],[0,"pn-marketweb-siteheader-search",{"i18n":[8,"i-1-8n"],"showOnlyLink":[1028,"show-only-link"],"hideSearch":[1028,"hide-search"],"search":[1040]}],[4,"pn-site-selector",{"buttontext":[1],"heading":[1],"language":[1],"i18n":[32]}],[0,"pn-site-selector-item",{"url":[1],"heading":[1],"description":[1],"newwindow":[4]}]]],["pn-product-tile_3",[[4,"pn-product-tile"],[0,"pn-product-tile-info",{"label":[1],"text":[1],"icon":[1]}],[0,"pn-product-tile-price",{"label":[1],"amount":[1],"currency":[1],"url":[1]}]]]], options);
13
+ return bootstrapLazy([["pn-marketweb-siteheader",[[4,"pn-marketweb-siteheader",{"market":[1],"language":[1],"endpoint":[1],"hideSiteSelector":[1028,"hide-site-selector"],"hideLanguageSelector":[1028,"hide-language-selector"],"hideSearch":[1028,"hide-search"],"hideLogin":[1028,"hide-login"],"i18n":[32],"gotData":[32],"fetchingData":[32],"menuItems":[32],"siteDefinition":[32],"search":[32],"siteSelector":[32],"languageSelector":[32],"loginDialog":[32],"minimizeSearch":[32]},[[9,"resize","handleResize"]]]]],["pn-find-service-and-price",[[0,"pn-find-service-and-price",{"source":[1],"language":[1025],"market":[1025],"filteredItems":[32],"postagetype":[32],"weight":[32],"weightvalue":[32],"deliveryscope":[32],"sourceData":[32]}]]],["pn-product-pricelist",[[4,"pn-product-pricelist",{"source":[1],"language":[1025],"market":[1025],"productid":[1],"filteredItems":[32],"sourceData":[32],"gotData":[32],"loading":[32],"postagetype":[32],"weight":[32],"weightvalue":[32]}]]],["pn-site-footer_2",[[4,"pn-site-footer",{"url":[1]}],[4,"pn-site-footer-col"]]],["pn-marketweb-sitefooter",[[0,"pn-marketweb-sitefooter",{"market":[1],"language":[1],"endpoint":[1],"siteDefinition":[32],"footerContent":[32],"i18n":[32],"gotData":[32],"fetchingData":[32]}]]],["pn-product-pricelist-result",[[0,"pn-product-pricelist-result",{"item":[1040],"shownitems":[16],"weightText":[32]}]]],["pn-choice-button_2",[[0,"pn-find-service-and-price-result",{"item":[1040],"shownitems":[16],"weightText":[32]}],[4,"pn-choice-button",{"value":[520],"name":[1],"choiceid":[1],"type":[1],"disabled":[4],"checked":[4],"indeterminate":[1028]},[[0,"change","handlechange"]]]]],["pn-mainnav-link",[[4,"pn-mainnav-link",{"name":[1],"href":[1],"target":[1],"linkid":[1],"levelId":[32],"open":[32],"hasChildren":[32]}]]],["pn-language-selector_9",[[4,"pn-mainnav-level",{"level":[32],"levelId":[32],"isOpen":[32],"parentName":[32],"parentHref":[32],"parentLinkId":[32],"listCount":[32],"alignment":[32]}],[4,"pn-language-selector",{"value":[1537],"selectedLanguageName":[32],"options":[32],"i18n":[32]}],[0,"pn-language-selector-option",{"name":[1],"code":[1],"url":[1],"selected":[4],"currentLanguage":[1,"current-language"]}],[4,"pn-mainnav",{"market":[1],"language":[1],"navigationId":[1,"navigation-id"],"openMenu":[1028,"open-menu"]},[[0,"language","setLanguage"],[0,"market","setMarket"],[0,"menuLanguageChange","onLanguageChange"],[0,"setmenuopen","setOpenMenu"],[0,"openMenuLevelChange","onOpenMenuLevelChange"]]],[4,"pn-mainnav-list",{"heading":[1],"linkCount":[32]}],[0,"pn-marketweb-siteheader-login",{"endpoint":[1],"i18n":[8,"i-1-8n"],"loginDialog":[1040],"loginManager":[32],"loggedIn":[32],"toggleButtonText":[32]}],[0,"pn-marketweb-siteheader-search",{"i18n":[8,"i-1-8n"],"showOnlyLink":[1028,"show-only-link"],"hideSearch":[1028,"hide-search"],"search":[1040]}],[4,"pn-site-selector",{"buttontext":[1],"heading":[1],"language":[1],"i18n":[32]}],[0,"pn-site-selector-item",{"url":[1],"heading":[1],"description":[1],"newwindow":[4]}]]],["pn-product-tile_3",[[4,"pn-product-tile"],[0,"pn-product-tile-info",{"label":[1],"text":[1],"icon":[1]}],[0,"pn-product-tile-price",{"label":[1],"amount":[1],"currency":[1],"url":[1]}]]]], options);
14
14
  });
15
15
  };
16
16
 
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, h, a as Host, c as getElement } from './index-52dc19ca.js';
2
- import { s as state } from './pn-find-service-and-price-store-0c7083bd.js';
2
+ import { s as state } from './pn-find-service-and-price-store-d02cbfe1.js';
3
3
  import './index-7c277874.js';
4
4
 
5
5
  const pnChoiceButtonCss = "pn-choice-button{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border:none;display:inline-block;background:#fff;position:relative;margin:0.2em 0.4em}pn-choice-button input{opacity:0;position:absolute;top:0;left:0;pointer-events:none;margin:0;width:100%;height:100%}pn-choice-button label{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;padding:0.4rem 0.8rem;border:0.1rem solid #D3CECB;color:#005D92;font-weight:500;border-radius:0.8rem;text-align:center;cursor:pointer;-webkit-transition:background 0.2s, -webkit-box-shadow 0.1s;transition:background 0.2s, -webkit-box-shadow 0.1s;transition:box-shadow 0.1s, background 0.2s;transition:box-shadow 0.1s, background 0.2s, -webkit-box-shadow 0.1s}pn-choice-button label pn-illustration{display:inline-block;width:3rem;height:3rem;margin-right:0.9rem}pn-choice-button>input:checked+label.pn-choice-button{background:#E0F8FF;color:#005D92;border-color:#005D92;-webkit-box-shadow:0px 0.6px 1.8px rgba(0, 0, 0, 0.1), 0px 3.2px 7.2px rgba(0, 0, 0, 0.13);box-shadow:0px 0.6px 1.8px rgba(0, 0, 0, 0.1), 0px 3.2px 7.2px rgba(0, 0, 0, 0.13)}pn-choice-button>input:indeterminate+label.pn-choice-button{background:#FFFFFF;color:#005D92}pn-choice-button>input:hover+label.pn-choice-button{background:#E0F8FF}pn-choice-button>input:focus+label.pn-choice-button,pn-choice-button>input:active+label.pn-choice-button{-webkit-box-shadow:0 0 0 0.2rem #fff, 0 0 0 0.4rem #005D92;box-shadow:0 0 0 0.2rem #fff, 0 0 0 0.4rem #005D92}pn-choice-button>input:active+label.pn-choice-button{background:#8EDDF9}pn-choice-button>input:disabled+label.pn-choice-button{background-color:#D3CECB}pn-choice-button>input:checked+label.pn-choice-button:hover{background:#8EDDF9}pn-choice-button>input:checked+label.pn-choice-button:active{background:#8EDDF9;border:0.1rem solid #00A0D6}";
@@ -62,7 +62,7 @@ const PnfindServiceAndPriceResult = class {
62
62
  (this.item.what === "letter" && this.item.maxweight > 999) ? Math.round(this.item.maxweight / 1000) + " kg" : this.item.maxweight + " g";
63
63
  }
64
64
  render() {
65
- return (h(Host, null, this.shownitems.map((item) => (h("pn-product-tile", null, h("pn-illustration", { slot: "illustration", illustration: item.illustration }), h("div", { slot: "content" }, h("div", { class: "content" }, h("h3", null, item.name), (item.description) ? (h("div", { class: "description" }, item.description)) : null, (item.info) ? (h("div", { class: "description" }, item.info)) : null)), item.maxweight ? (h("pn-product-tile-info", { label: state.i18n.maxweightlabel, text: this.weightText })) : null, item.maximummeasurements ? (h("pn-product-tile-info", { label: state.i18n.maxmeasurementlabel, text: item.maximummeasurements })) : null, item.pricestamps ? (h("pn-product-tile-price", { slot: "price", label: "With stamps", amount: item.pricestamps + '', currency: state.market.currency })) : null, item.priceagent ? (h("pn-product-tile-price", { slot: "price", label: "Service point", amount: item.priceagent + '', currency: state.market.currency, url: "https://shop.postnord.se/ebutik/default.aspx" })) : null, item.pricesenddirect ? (h("pn-product-tile-price", { slot: "price", label: "Send direct", amount: item.pricesenddirect + '', currency: state.market.currency, url: "https://portal.postnord.com/skickadirekt/" })) : null, item.info ? (h("small", { slot: "note" }, h("p", null, item.note))) : null)))));
65
+ return (h(Host, null, this.shownitems.map((item) => (h("pn-product-tile", null, h("pn-illustration", { slot: "illustration", illustration: item.illustration }), h("div", { slot: "content" }, h("div", { class: "content" }, h("h3", null, item.name), (item.description) ? (h("div", { class: "description" }, item.description)) : null, (item.info) ? (h("div", { class: "description" }, item.info)) : null)), item.maxweight ? (h("pn-product-tile-info", { label: state.i18n.maxweightlabel, text: this.weightText })) : null, item.maximummeasurements ? (h("pn-product-tile-info", { label: state.i18n.maxmeasurementlabel, text: item.maximummeasurements })) : null, item.pricestamps ? (h("pn-product-tile-price", { slot: "price", label: state.i18n.stampshopcta, amount: item.pricestamps + '', currency: state.market.currency })) : null, item.priceagent ? (h("pn-product-tile-price", { slot: "price", label: "", amount: item.priceagent + '', currency: state.market.currency, url: "https://shop.postnord.se/ebutik/default.aspx" })) : null, item.pricesenddirect ? (h("pn-product-tile-price", { slot: "price", label: state.i18n.senddirectcta, amount: item.pricesenddirect + '', currency: state.market.currency, url: "https://portal.postnord.com/skickadirekt/" })) : null, item.note ? (h("small", { slot: "note" }, h("p", null, item.note))) : null)))));
66
66
  }
67
67
  static get watchers() { return {
68
68
  "item": ["composeItems"]
@@ -9,7 +9,9 @@ const { state, onChange } = createStore({
9
9
  resultlistheading: '',
10
10
  weightlabel: '',
11
11
  maxweightlabel: '',
12
- maxmeasurementlabel: ''
12
+ maxmeasurementlabel: '',
13
+ senddirectcta: '',
14
+ stampshopcta: '',
13
15
  },
14
16
  market: {
15
17
  currency: ""