@visitscotland/component-library 1.0.26 → 1.0.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [1.0.27](https://github.com/visitscotland/vs-component-library/compare/v1.0.26...v1.0.27) (2023-09-13)
6
+
7
+
8
+ ### 🐛 Bug Fixes
9
+
10
+ * **onetrust:** fix missing window in ssr error ([ad47d74](https://github.com/visitscotland/vs-component-library/commit/ad47d74d7d21650da2c209a1715183fb54c07b2c))
11
+
5
12
  ### [1.0.26](https://github.com/visitscotland/vs-component-library/compare/v1.0.25...v1.0.26) (2023-09-12)
6
13
 
7
14
 
@@ -201,7 +201,7 @@
201
201
  "scripts/b1355b8d61822d820c3c.js",
202
202
  "scripts/f8af198424679e336ce9.js",
203
203
  "scripts/3174db281106a2d5e619.js",
204
- "scripts/c788c99f37db9b766c04.js"
204
+ "scripts/e2d75b0fff8d7d6c7f33.js"
205
205
  ]
206
206
  },
207
207
  "VsCookiesFallback": {
@@ -927,7 +927,7 @@
927
927
  "scripts/c609148fc3e4bae68f67.js",
928
928
  "scripts/24228f9eee7eb5c30688.js",
929
929
  "scripts/3174db281106a2d5e619.js",
930
- "scripts/4a0169bf91e4e2397bcf.js",
930
+ "scripts/735b36d8513eefa1d4c2.js",
931
931
  "scripts/52a88ad64041afb98d43.js",
932
932
  "scripts/5cb7b258824862644a28.js",
933
933
  "scripts/68f7c6031293430987cd.js"
@@ -2001,7 +2001,7 @@
2001
2001
  "scripts/24228f9eee7eb5c30688.js",
2002
2002
  "scripts/af20ced2e34b6801258c.js",
2003
2003
  "scripts/3174db281106a2d5e619.js",
2004
- "scripts/4a0169bf91e4e2397bcf.js",
2004
+ "scripts/735b36d8513eefa1d4c2.js",
2005
2005
  "scripts/52a88ad64041afb98d43.js",
2006
2006
  "scripts/5cb7b258824862644a28.js",
2007
2007
  "scripts/9a5b8573e2af7b27fdeb.js",
@@ -2260,7 +2260,7 @@
2260
2260
  "scripts/24228f9eee7eb5c30688.js",
2261
2261
  "scripts/d0fd50a5b063d113a609.js",
2262
2262
  "scripts/3174db281106a2d5e619.js",
2263
- "scripts/4a0169bf91e4e2397bcf.js",
2263
+ "scripts/735b36d8513eefa1d4c2.js",
2264
2264
  "scripts/e4da1861edcade544efd.js"
2265
2265
  ],
2266
2266
  "styles": [
@@ -2909,7 +2909,7 @@
2909
2909
  "scripts/24228f9eee7eb5c30688.js",
2910
2910
  "scripts/af20ced2e34b6801258c.js",
2911
2911
  "scripts/3174db281106a2d5e619.js",
2912
- "scripts/4a0169bf91e4e2397bcf.js",
2912
+ "scripts/735b36d8513eefa1d4c2.js",
2913
2913
  "scripts/52a88ad64041afb98d43.js",
2914
2914
  "scripts/e3df89c35c49687c02b1.js",
2915
2915
  "scripts/1448817d8612666a0079.js",
@@ -4081,7 +4081,7 @@
4081
4081
  "scripts/24228f9eee7eb5c30688.js",
4082
4082
  "scripts/af20ced2e34b6801258c.js",
4083
4083
  "scripts/3174db281106a2d5e619.js",
4084
- "scripts/4a0169bf91e4e2397bcf.js",
4084
+ "scripts/735b36d8513eefa1d4c2.js",
4085
4085
  "scripts/52a88ad64041afb98d43.js",
4086
4086
  "scripts/5cb7b258824862644a28.js",
4087
4087
  "scripts/9a5b8573e2af7b27fdeb.js",
@@ -4136,7 +4136,7 @@
4136
4136
  "scripts/24228f9eee7eb5c30688.js",
4137
4137
  "scripts/af20ced2e34b6801258c.js",
4138
4138
  "scripts/3174db281106a2d5e619.js",
4139
- "scripts/4a0169bf91e4e2397bcf.js",
4139
+ "scripts/735b36d8513eefa1d4c2.js",
4140
4140
  "scripts/52a88ad64041afb98d43.js",
4141
4141
  "scripts/5cb7b258824862644a28.js",
4142
4142
  "scripts/9a5b8573e2af7b27fdeb.js",
@@ -4448,7 +4448,7 @@
4448
4448
  "scripts/af20ced2e34b6801258c.js",
4449
4449
  "scripts/d0fd50a5b063d113a609.js",
4450
4450
  "scripts/3174db281106a2d5e619.js",
4451
- "scripts/4a0169bf91e4e2397bcf.js",
4451
+ "scripts/735b36d8513eefa1d4c2.js",
4452
4452
  "scripts/52a88ad64041afb98d43.js",
4453
4453
  "scripts/5cb7b258824862644a28.js",
4454
4454
  "scripts/9a5b8573e2af7b27fdeb.js",
@@ -4507,7 +4507,7 @@
4507
4507
  "scripts/af20ced2e34b6801258c.js",
4508
4508
  "scripts/d0fd50a5b063d113a609.js",
4509
4509
  "scripts/3174db281106a2d5e619.js",
4510
- "scripts/4a0169bf91e4e2397bcf.js",
4510
+ "scripts/735b36d8513eefa1d4c2.js",
4511
4511
  "scripts/52a88ad64041afb98d43.js",
4512
4512
  "scripts/5cb7b258824862644a28.js",
4513
4513
  "scripts/9a5b8573e2af7b27fdeb.js",
@@ -4833,7 +4833,7 @@
4833
4833
  "scripts/3a9571cfaf25865bccc9.js",
4834
4834
  "scripts/d77b7b29af4fb24edbe0.js",
4835
4835
  "scripts/414cc4d3f993aab28a8f.js",
4836
- "scripts/715bb6a96d7bf32e6f14.js",
4836
+ "scripts/e0a7582dafca3697a831.js",
4837
4837
  "scripts/6f8a69836503b59819ba.js",
4838
4838
  "scripts/8c5347740d69b612c97c.js",
4839
4839
  "scripts/891ff7a5d9b432a92b97.js"
@@ -4907,7 +4907,7 @@
4907
4907
  "scripts/c609148fc3e4bae68f67.js",
4908
4908
  "scripts/e57aeb2f5204c61f5555.js",
4909
4909
  "scripts/bbffd3414a7c7fddbcd6.js",
4910
- "scripts/715bb6a96d7bf32e6f14.js",
4910
+ "scripts/e0a7582dafca3697a831.js",
4911
4911
  "scripts/f027bc5a4b3fd5eb22f1.js",
4912
4912
  "scripts/1b952d87bc0aca49a896.js",
4913
4913
  "scripts/1701a9402143e4b7b77c.js"
@@ -4997,7 +4997,7 @@
4997
4997
  "scripts/c609148fc3e4bae68f67.js",
4998
4998
  "scripts/e57aeb2f5204c61f5555.js",
4999
4999
  "scripts/bbffd3414a7c7fddbcd6.js",
5000
- "scripts/715bb6a96d7bf32e6f14.js",
5000
+ "scripts/e0a7582dafca3697a831.js",
5001
5001
  "scripts/f027bc5a4b3fd5eb22f1.js",
5002
5002
  "scripts/37647589fe5f0407574d.js"
5003
5003
  ],
@@ -5100,7 +5100,7 @@
5100
5100
  "scripts/e57aeb2f5204c61f5555.js",
5101
5101
  "scripts/32ca64baf0af7b9faffa.js",
5102
5102
  "scripts/bbffd3414a7c7fddbcd6.js",
5103
- "scripts/715bb6a96d7bf32e6f14.js",
5103
+ "scripts/e0a7582dafca3697a831.js",
5104
5104
  "scripts/f027bc5a4b3fd5eb22f1.js",
5105
5105
  "scripts/6f8a69836503b59819ba.js",
5106
5106
  "scripts/1b952d87bc0aca49a896.js",
@@ -5108,7 +5108,7 @@
5108
5108
  "scripts/6c28685f52b01d108e4d.js",
5109
5109
  "scripts/aa3efed6b1f6232ce3fe.js",
5110
5110
  "scripts/96174af322a67416c0a9.js",
5111
- "scripts/9f1410bbc12b850a2071.js",
5111
+ "scripts/3540424e88e90142beb5.js",
5112
5112
  "scripts/97cddd3583069debb72b.js"
5113
5113
  ],
5114
5114
  "styles": [
@@ -5119,7 +5119,7 @@
5119
5119
  "styles/1b952d87bc0aca49a896.css",
5120
5120
  "styles/8c5347740d69b612c97c.css",
5121
5121
  "styles/6c28685f52b01d108e4d.css",
5122
- "styles/9f1410bbc12b850a2071.css"
5122
+ "styles/3540424e88e90142beb5.css"
5123
5123
  ]
5124
5124
  },
5125
5125
  "VsSelectInput": {
@@ -5228,7 +5228,7 @@
5228
5228
  "scripts/e57aeb2f5204c61f5555.js",
5229
5229
  "scripts/32ca64baf0af7b9faffa.js",
5230
5230
  "scripts/bbffd3414a7c7fddbcd6.js",
5231
- "scripts/715bb6a96d7bf32e6f14.js",
5231
+ "scripts/e0a7582dafca3697a831.js",
5232
5232
  "scripts/f027bc5a4b3fd5eb22f1.js",
5233
5233
  "scripts/6f8a69836503b59819ba.js",
5234
5234
  "scripts/1b952d87bc0aca49a896.js",
@@ -5236,7 +5236,7 @@
5236
5236
  "scripts/6c28685f52b01d108e4d.js",
5237
5237
  "scripts/aa3efed6b1f6232ce3fe.js",
5238
5238
  "scripts/96174af322a67416c0a9.js",
5239
- "scripts/9f1410bbc12b850a2071.js",
5239
+ "scripts/3540424e88e90142beb5.js",
5240
5240
  "scripts/898c147b72953c7d8efb.js"
5241
5241
  ],
5242
5242
  "styles": [
@@ -5250,7 +5250,7 @@
5250
5250
  "styles/1b952d87bc0aca49a896.css",
5251
5251
  "styles/8c5347740d69b612c97c.css",
5252
5252
  "styles/6c28685f52b01d108e4d.css",
5253
- "styles/9f1410bbc12b850a2071.css",
5253
+ "styles/3540424e88e90142beb5.css",
5254
5254
  "styles/898c147b72953c7d8efb.css"
5255
5255
  ]
5256
5256
  },
@@ -5759,7 +5759,7 @@
5759
5759
  "scripts/24228f9eee7eb5c30688.js",
5760
5760
  "scripts/af20ced2e34b6801258c.js",
5761
5761
  "scripts/3174db281106a2d5e619.js",
5762
- "scripts/4a0169bf91e4e2397bcf.js",
5762
+ "scripts/735b36d8513eefa1d4c2.js",
5763
5763
  "scripts/52a88ad64041afb98d43.js",
5764
5764
  "scripts/5cb7b258824862644a28.js",
5765
5765
  "scripts/9a5b8573e2af7b27fdeb.js",
@@ -6202,7 +6202,7 @@
6202
6202
  "scripts/c609148fc3e4bae68f67.js",
6203
6203
  "scripts/24228f9eee7eb5c30688.js",
6204
6204
  "scripts/3174db281106a2d5e619.js",
6205
- "scripts/4a0169bf91e4e2397bcf.js",
6205
+ "scripts/735b36d8513eefa1d4c2.js",
6206
6206
  "scripts/52a88ad64041afb98d43.js",
6207
6207
  "scripts/e3df89c35c49687c02b1.js",
6208
6208
  "scripts/1448817d8612666a0079.js",
@@ -1 +1 @@
1
- (self.webpackChunk_visitscotland_component_library=self.webpackChunk_visitscotland_component_library||[]).push([[7809],{53115:function(){},34156:function(e,t,a){"use strict";var n=a(93379),l=a.n(n),o=a(7795),r=a.n(o),u=a(90569),c=a.n(u),i=a(3565),s=a.n(i),d=a(19216),f=a.n(d),v=a(44589),p=a.n(v),m=a(53115),b=a.n(m),h={};h.styleTagTransform=p(),h.setAttributes=s(),h.insert=c().bind(null,"head"),h.domAPI=r(),h.insertStyleElement=f(),l()(b(),h),b()&&b().locals&&b().locals},43062:function(e,t,a){"use strict";var n=this&&this.__awaiter||function(e,t,a,n){return new(a||(a=Promise))((function(l,o){function r(e){try{c(n.next(e))}catch(e){o(e)}}function u(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?l(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(r,u)}c((n=n.apply(e,t||[])).next())}))},l=this&&this.__generator||function(e,t){var a,n,l,o,r={label:0,sent:function(){if(1&l[0])throw l[1];return l[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(u){return function(c){return function(u){if(a)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(r=0)),r;)try{if(a=1,n&&(l=2&u[0]?n.return:u[0]?n.throw||((l=n.return)&&l.call(n),0):n.next)&&!(l=l.call(n,u[1])).done)return l;switch(n=0,l&&(u=[2&u[0],l.value]),u[0]){case 0:case 1:l=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,n=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(!((l=(l=r.trys).length>0&&l[l.length-1])||6!==u[0]&&2!==u[0])){r=0;continue}if(3===u[0]&&(!l||u[1]>l[0]&&u[1]<l[3])){r.label=u[1];break}if(6===u[0]&&r.label<l[1]){r.label=l[1],l=u;break}if(l&&r.label<l[2]){r.label=l[2],r.ops.push(u);break}l[2]&&r.ops.pop(),r.trys.pop();continue}u=t.call(e,r)}catch(e){u=[6,e],n=0}finally{a=l=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var r=a(76765),u=a(76765),c={class:"vs-product-search-embed"},i={class:"container"},s={class:"row"},d={class:"col-12"},f=["action","onSubmit"],v={"aria-live":"polite"},p=["disabled","value"],m=["disabled","value"],b=["value"],h={key:4,type:"hidden",name:"areaproxdist",value:"10"},y={key:5},k={key:3},g=[(0,u.createElementVNode)("input",{hidden:"true",name:"avail",value:"on"},null,-1)],w={key:0},_=["value"],T=a(76765),N=a(12147),V=a(61309),x=a(68504),E=a(83506),L=o(a(27175)),B=o(a(17710)),S=o(a(49335)),C=o(a(10501)),P=o(a(96971)),D=o(a(83918));t.default=(0,r.defineComponent)({__name:"ProductSearchEmbed",props:{defaultProd:{type:String,default:"acti,attr,reta"},defaultLocation:{type:String,default:""},defaultLocale:{type:String,default:"fr"}},setup:function(e){var t=this,a=e,o=(0,T.ref)(),r=(0,T.ref)([]),O=((0,T.ref)(null),(0,T.ref)()),j=(0,T.ref)(!1),M=(0,T.computed)((function(){var e=void 0===o.value?"see-do":o.value;return"/info/".concat(V.paths[e])})),A=!1,F=(0,T.computed)((function(){var e=a.defaultLocale.length>0?a.defaultLocale:(0,N.getLocale)();return"en"===e&&(e=""),e})),U=(0,T.computed)((function(){return"".concat(V.baseUrl.prod).concat(F.value?"/"+F.value:"").concat(M.value,"/search-results")})),I="https://www.visitscotland.com/data/locations?locale=".concat(F.value),G=(0,T.ref)([]),R=function(e){O.value=G.value.find((function(t){return t.name===e}))},J=(0,T.ref)([]),Y=(0,T.ref)([]),K=(0,T.ref)([]);(0,T.onMounted)((function(){return n(t,void 0,void 0,(function(){var e,t,n;return l(this,(function(l){switch(l.label){case 0:return[4,(0,E.getData)(I)];case 1:return(e=l.sent())&&(G.value=e.data),""!==a.defaultLocation&&R(a.defaultLocation),A=!0,o.value=a.defaultProd,r=(0,x.getProductTypes)(),u=[],r.forEach((function(e){u.push(e)})),J.value=u,[4,(0,E.getData)("https://www.visitscotland.com/tms-api/v1/attractions")];case 2:return(t=l.sent())&&(Y.value=t.data),[4,(0,E.getData)("https://www.visitscotland.com/tms-api/v1/origins?active=1")];case 3:return(n=l.sent())&&(K.value=n.data),[2]}var r,u}))}))}));var q=function(e){j.value=!0;var t=e.currentTarget;setTimeout((function(){t.submit()}),500)};return function(t,a){var n,l,T,x,E,M;return(0,u.openBlock)(),(0,u.createElementBlock)("div",c,[(0,u.createElementVNode)("div",i,[(0,u.createElementVNode)("div",s,[(0,u.createElementVNode)("div",d,[(0,u.createElementVNode)("form",{action:U.value,onSubmit:(0,u.withModifiers)(q,["prevent"]),"accept-charset":"UTF-8"},[(0,u.createVNode)(S.default,{label:(0,u.unref)(N.getLabelText)("for","For"),id:"select-type",name:"prodtypes","default-selected":e.defaultProd,onChangeOption:a[0]||(a[0]=function(e){return o.value=e}),options:J.value},null,8,["label","default-selected","options"]),(0,u.createElementVNode)("div",v,["tour"!=o.value&&(0,u.unref)(A)?((0,u.openBlock)(),(0,u.createBlock)(L.default,{key:0,id:"search-location",label:(0,u.unref)(N.getLabelText)("location","Location"),"multiselect-label":"name",name:"loc",options:G.value,placeholder:(0,u.unref)(N.getLabelText)("location_placeholder","Enter a location"),"track-by":"name",onChangeValue:a[1]||(a[1]=function(e){return R(e)}),"default-val":(0,u.unref)(O)},null,8,["label","options","placeholder","default-val"])):(0,u.createCommentVNode)("",!0),"tour"!==o.value?((0,u.openBlock)(),(0,u.createElementBlock)("input",{key:1,type:"hidden",name:"locplace",disabled:"POLYGON"===(null===(n=(0,u.unref)(O))||void 0===n?void 0:n.type),value:(null===(l=(0,u.unref)(O))||void 0===l?void 0:l.key)||""},null,8,p)):(0,u.createCommentVNode)("",!0),"tour"!==o.value?((0,u.openBlock)(),(0,u.createElementBlock)("input",{key:2,type:"hidden",name:"locpoly",disabled:"POLYGON"!==(null===(T=(0,u.unref)(O))||void 0===T?void 0:T.type),value:(null===(x=(0,u.unref)(O))||void 0===x?void 0:x.key)||""},null,8,m)):(0,u.createCommentVNode)("",!0),"tour"!==o.value?((0,u.openBlock)(),(0,u.createElementBlock)("input",{key:3,type:"hidden",name:"locprox",value:"DISTRICT"===(null===(E=(0,u.unref)(O))||void 0===E?void 0:E.type)?1:0},null,8,b)):(0,u.createCommentVNode)("",!0),"tour"!==o.value&&"DISTRICT"===(null===(M=(0,u.unref)(O))||void 0===M?void 0:M.type)?((0,u.openBlock)(),(0,u.createElementBlock)("input",h)):(0,u.createCommentVNode)("",!0),"even"===o.value||"acco"===o.value?((0,u.openBlock)(),(0,u.createElementBlock)("div",y,["even"===o.value||"acco"===o.value?((0,u.openBlock)(),(0,u.createBlock)(P.default,{key:0,legend:(0,u.unref)(N.getLabelText)("date_label","Dates"),"start-label":(0,u.unref)(N.getLabelText)("checkin","Start Date","dates"),"end-label":(0,u.unref)(N.getLabelText)("checkout","End Date","dates"),"default-dates":j.value},null,8,["legend","start-label","end-label","default-dates"])):(0,u.createCommentVNode)("",!0),"even"===o.value?((0,u.openBlock)(),(0,u.createBlock)(C.default,{key:1,name:"name",label:(0,u.unref)(N.getLabelText)("keywords","Keywords"),id:"search-keywords"},null,8,["label"])):(0,u.createCommentVNode)("",!0),"acco"===o.value?((0,u.openBlock)(),(0,u.createBlock)(B.default,{key:2,availability:!0,label:(0,u.unref)(N.getLabelText)("guests","Guests"),id:"guest-selector"},null,8,["label"])):(0,u.createCommentVNode)("",!0),"acco"===o.value?((0,u.openBlock)(),(0,u.createElementBlock)("div",k,g)):(0,u.createCommentVNode)("",!0)])):(0,u.createCommentVNode)("",!0)]),"tour"===o.value?((0,u.openBlock)(),(0,u.createElementBlock)("div",w,[(0,u.createVNode)(L.default,{id:"tour-origin",label:(0,u.unref)(N.getLabelText)("tour_origin","Starting point"),"multiselect-label":"name",name:"origins[]",options:K.value,placeholder:(0,u.unref)(N.getLabelText)("tour_origin_placeholder","Location"),"track-by":"name","is-tour-location":!0},null,8,["label","options","placeholder"]),((0,u.openBlock)(!0),(0,u.createElementBlock)(u.Fragment,null,(0,u.renderList)(r.value,(function(e){return(0,u.openBlock)(),(0,u.createElementBlock)("input",{type:"hidden",name:"attractions[]",value:e},null,8,_)})),256)),(0,u.createVNode)(L.default,{id:"tour-month",label:(0,u.unref)(N.getLabelText)("tour_month","I'm traveling in"),"multiselect-label":"label",name:"when",options:(0,u.unref)(N.getLabelText)("months",(0,u.unref)(V.monthsEnglish)),placeholder:(0,u.unref)(N.getLabelText)("tour_month_placeholder","Select month"),"track-by":"value"},null,8,["label","options","placeholder"])])):(0,u.createCommentVNode)("",!0),(0,u.createVNode)(D.default,{class:"mt-6",variant:"dark"},{default:(0,u.withCtx)((function(){return[(0,u.createTextVNode)((0,u.toDisplayString)((0,u.unref)(N.getLabelText)("search","Search")),1)]})),_:1})],40,f)])])])])}}})},61309:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.monthsEnglish=t.baseUrl=t.paths=t.products=void 0,t.products=[{key:"accommodation",displayName:"Accommodation",optionValue:"acco"},{key:"eventsAndFestivals",displayName:"Events & Festivals",optionValue:"even"},{key:"foodAndDrink",displayName:"Food & Drink",optionValue:"cate"},{key:"thingsToDo",displayName:"Things to do",optionValue:"acti,attr,reta"},{key:"tours",displayName:"Tours",optionValue:"tour"}],t.paths={acco:"accommodation","acti,attr,reta":"see-do",cate:"food-drink",even:"events",tour:"tours"},t.baseUrl={dev:"http://172.28.81.65:8089",prod:"https://www.visitscotland.com"},t.monthsEnglish=[{label:"January",value:"january"},{label:"February",value:"february"},{label:"March",value:"march"},{label:"April",value:"april"},{label:"May",value:"may"},{label:"June",value:"june"},{label:"July",value:"july"},{label:"August",value:"august"},{label:"September",value:"september"},{label:"October",value:"october"},{label:"November",value:"november"},{label:"December",value:"december"}]},83506:function(e,t,a){"use strict";var n=a(25108),l=this&&this.__awaiter||function(e,t,a,n){return new(a||(a=Promise))((function(l,o){function r(e){try{c(n.next(e))}catch(e){o(e)}}function u(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?l(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(r,u)}c((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var a,n,l,o,r={label:0,sent:function(){if(1&l[0])throw l[1];return l[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(u){return function(c){return function(u){if(a)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(r=0)),r;)try{if(a=1,n&&(l=2&u[0]?n.return:u[0]?n.throw||((l=n.return)&&l.call(n),0):n.next)&&!(l=l.call(n,u[1])).done)return l;switch(n=0,l&&(u=[2&u[0],l.value]),u[0]){case 0:case 1:l=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,n=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(!((l=(l=r.trys).length>0&&l[l.length-1])||6!==u[0]&&2!==u[0])){r=0;continue}if(3===u[0]&&(!l||u[1]>l[0]&&u[1]<l[3])){r.label=u[1];break}if(6===u[0]&&r.label<l[1]){r.label=l[1],l=u;break}if(l&&r.label<l[2]){r.label=l[2],r.ops.push(u);break}l[2]&&r.ops.pop(),r.trys.pop();continue}u=t.call(e,r)}catch(e){u=[6,e],n=0}finally{a=l=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getData=void 0;var u=r(a(97218));t.getData=function(e){return l(this,void 0,void 0,(function(){var t;return o(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,u.default.get(e)];case 1:return[2,a.sent().data];case 2:return t=a.sent(),n.error("Axios error: ".concat(t)),[3,3];case 3:return[2]}}))}))}},68504:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getProductTypes=t.getURLParameters=void 0;var n,l=a(61309);n="undefined"!=typeof variable&&"object"==typeof window.VS?window.VS:{},t.getURLParameters=function(){var e=new URLSearchParams(document.location.search),t=Object.fromEntries(e);return"object"==typeof t&&Object.keys(t).forEach((function(e){return null===t[e]&&delete t[e]})),t},t.getProductTypes=function(){if(Object.keys(n).length<=0)return l.products;var e=n.search_config.basic_config.productTypes,t=[];return Object.keys(e).forEach((function(a){t.push({key:e[a].value,displayName:e[a].text,optionValue:e[a].value})})),t}},97809:function(e,t,a){"use strict";a.r(t);var n=a(65531),l={};for(var o in n)"default"!==o&&(l[o]=function(e){return n[e]}.bind(0,o));a.d(t,l),a(76633);const r=n.default;t.default=r},76633:function(e,t,a){"use strict";a(34156)},65531:function(e,t,a){"use strict";a.r(t),a.d(t,{default:function(){return l.a}});var n=a(43062),l=a.n(n),o={};for(var r in n)"default"!==r&&(o[r]=function(e){return n[e]}.bind(0,r));a.d(t,o)}}]);
1
+ (self.webpackChunk_visitscotland_component_library=self.webpackChunk_visitscotland_component_library||[]).push([[7809],{53115:function(){},34156:function(e,t,a){"use strict";var n=a(93379),o=a.n(n),l=a(7795),r=a.n(l),u=a(90569),c=a.n(u),i=a(3565),s=a.n(i),d=a(19216),f=a.n(d),v=a(44589),p=a.n(v),m=a(53115),b=a.n(m),h={};h.styleTagTransform=p(),h.setAttributes=s(),h.insert=c().bind(null,"head"),h.domAPI=r(),h.insertStyleElement=f(),o()(b(),h),b()&&b().locals&&b().locals},43062:function(e,t,a){"use strict";var n=this&&this.__awaiter||function(e,t,a,n){return new(a||(a=Promise))((function(o,l){function r(e){try{c(n.next(e))}catch(e){l(e)}}function u(e){try{c(n.throw(e))}catch(e){l(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(r,u)}c((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var a,n,o,l,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return l={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l;function u(u){return function(c){return function(u){if(a)throw new TypeError("Generator is already executing.");for(;l&&(l=0,u[0]&&(r=0)),r;)try{if(a=1,n&&(o=2&u[0]?n.return:u[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,u[1])).done)return o;switch(n=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,n=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(!((o=(o=r.trys).length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){r=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){r.label=u[1];break}if(6===u[0]&&r.label<o[1]){r.label=o[1],o=u;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(u);break}o[2]&&r.ops.pop(),r.trys.pop();continue}u=t.call(e,r)}catch(e){u=[6,e],n=0}finally{a=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}},l=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var r=a(76765),u=a(76765),c={class:"vs-product-search-embed"},i={class:"container"},s={class:"row"},d={class:"col-12"},f=["action","onSubmit"],v={"aria-live":"polite"},p=["disabled","value"],m=["disabled","value"],b=["value"],h={key:4,type:"hidden",name:"areaproxdist",value:"10"},y={key:5},k={key:3},g=[(0,u.createElementVNode)("input",{hidden:"true",name:"avail",value:"on"},null,-1)],w={key:0},_=["value"],T=a(76765),N=a(12147),V=a(61309),x=a(68504),E=a(83506),L=l(a(27175)),B=l(a(17710)),S=l(a(49335)),C=l(a(10501)),P=l(a(96971)),D=l(a(83918));t.default=(0,r.defineComponent)({__name:"ProductSearchEmbed",props:{defaultProd:{type:String,default:"acti,attr,reta"},defaultLocation:{type:String,default:""},defaultLocale:{type:String,default:"fr"}},setup:function(e){var t=this,a=e,l=(0,T.ref)(),r=(0,T.ref)([]),O=((0,T.ref)(null),(0,T.ref)()),j=(0,T.ref)(!1),M=(0,T.computed)((function(){var e=void 0===l.value?"see-do":l.value;return"/info/".concat(V.paths[e])})),A=!1,F=(0,T.computed)((function(){var e=a.defaultLocale.length>0?a.defaultLocale:(0,N.getLocale)();return"en"===e&&(e=""),e})),U=(0,T.computed)((function(){return"".concat(V.baseUrl.prod).concat(F.value?"/"+F.value:"").concat(M.value,"/search-results")})),I="https://www.visitscotland.com/data/locations?locale=".concat(F.value),G=(0,T.ref)([]),R=function(e){O.value=G.value.find((function(t){return t.name===e}))},J=(0,T.ref)([]),Y=(0,T.ref)([]),K=(0,T.ref)([]);(0,T.onMounted)((function(){return n(t,void 0,void 0,(function(){var e,t,n;return o(this,(function(o){switch(o.label){case 0:return[4,(0,E.getData)(I)];case 1:return(e=o.sent())&&(G.value=e.data),""!==a.defaultLocation&&R(a.defaultLocation),A=!0,l.value=a.defaultProd,r=(0,x.getProductTypes)(),u=[],r.forEach((function(e){u.push(e)})),J.value=u,[4,(0,E.getData)("https://www.visitscotland.com/tms-api/v1/attractions")];case 2:return(t=o.sent())&&(Y.value=t.data),[4,(0,E.getData)("https://www.visitscotland.com/tms-api/v1/origins?active=1")];case 3:return(n=o.sent())&&(K.value=n.data),[2]}var r,u}))}))}));var q=function(e){j.value=!0;var t=e.currentTarget;setTimeout((function(){t.submit()}),500)};return function(t,a){var n,o,T,x,E,M;return(0,u.openBlock)(),(0,u.createElementBlock)("div",c,[(0,u.createElementVNode)("div",i,[(0,u.createElementVNode)("div",s,[(0,u.createElementVNode)("div",d,[(0,u.createElementVNode)("form",{action:U.value,onSubmit:(0,u.withModifiers)(q,["prevent"]),"accept-charset":"UTF-8"},[(0,u.createVNode)(S.default,{label:(0,u.unref)(N.getLabelText)("for","For"),id:"select-type",name:"prodtypes","default-selected":e.defaultProd,onChangeOption:a[0]||(a[0]=function(e){return l.value=e}),options:J.value},null,8,["label","default-selected","options"]),(0,u.createElementVNode)("div",v,["tour"!=l.value&&(0,u.unref)(A)?((0,u.openBlock)(),(0,u.createBlock)(L.default,{key:0,id:"search-location",label:(0,u.unref)(N.getLabelText)("location","Location"),"multiselect-label":"name",name:"loc",options:G.value,placeholder:(0,u.unref)(N.getLabelText)("location_placeholder","Enter a location"),"track-by":"name",onChangeValue:a[1]||(a[1]=function(e){return R(e)}),"default-val":(0,u.unref)(O)},null,8,["label","options","placeholder","default-val"])):(0,u.createCommentVNode)("",!0),"tour"!==l.value?((0,u.openBlock)(),(0,u.createElementBlock)("input",{key:1,type:"hidden",name:"locplace",disabled:"POLYGON"===(null===(n=(0,u.unref)(O))||void 0===n?void 0:n.type),value:(null===(o=(0,u.unref)(O))||void 0===o?void 0:o.key)||""},null,8,p)):(0,u.createCommentVNode)("",!0),"tour"!==l.value?((0,u.openBlock)(),(0,u.createElementBlock)("input",{key:2,type:"hidden",name:"locpoly",disabled:"POLYGON"!==(null===(T=(0,u.unref)(O))||void 0===T?void 0:T.type),value:(null===(x=(0,u.unref)(O))||void 0===x?void 0:x.key)||""},null,8,m)):(0,u.createCommentVNode)("",!0),"tour"!==l.value?((0,u.openBlock)(),(0,u.createElementBlock)("input",{key:3,type:"hidden",name:"locprox",value:"DISTRICT"===(null===(E=(0,u.unref)(O))||void 0===E?void 0:E.type)?1:0},null,8,b)):(0,u.createCommentVNode)("",!0),"tour"!==l.value&&"DISTRICT"===(null===(M=(0,u.unref)(O))||void 0===M?void 0:M.type)?((0,u.openBlock)(),(0,u.createElementBlock)("input",h)):(0,u.createCommentVNode)("",!0),"even"===l.value||"acco"===l.value?((0,u.openBlock)(),(0,u.createElementBlock)("div",y,["even"===l.value||"acco"===l.value?((0,u.openBlock)(),(0,u.createBlock)(P.default,{key:0,legend:(0,u.unref)(N.getLabelText)("date_label","Dates"),"start-label":(0,u.unref)(N.getLabelText)("checkin","Start Date","dates"),"end-label":(0,u.unref)(N.getLabelText)("checkout","End Date","dates"),"default-dates":j.value},null,8,["legend","start-label","end-label","default-dates"])):(0,u.createCommentVNode)("",!0),"even"===l.value?((0,u.openBlock)(),(0,u.createBlock)(C.default,{key:1,name:"name",label:(0,u.unref)(N.getLabelText)("keywords","Keywords"),id:"search-keywords"},null,8,["label"])):(0,u.createCommentVNode)("",!0),"acco"===l.value?((0,u.openBlock)(),(0,u.createBlock)(B.default,{key:2,availability:!0,label:(0,u.unref)(N.getLabelText)("guests","Guests"),id:"guest-selector"},null,8,["label"])):(0,u.createCommentVNode)("",!0),"acco"===l.value?((0,u.openBlock)(),(0,u.createElementBlock)("div",k,g)):(0,u.createCommentVNode)("",!0)])):(0,u.createCommentVNode)("",!0)]),"tour"===l.value?((0,u.openBlock)(),(0,u.createElementBlock)("div",w,[(0,u.createVNode)(L.default,{id:"tour-origin",label:(0,u.unref)(N.getLabelText)("tour_origin","Starting point"),"multiselect-label":"name",name:"origins[]",options:K.value,placeholder:(0,u.unref)(N.getLabelText)("tour_origin_placeholder","Location"),"track-by":"name","is-tour-location":!0},null,8,["label","options","placeholder"]),((0,u.openBlock)(!0),(0,u.createElementBlock)(u.Fragment,null,(0,u.renderList)(r.value,(function(e){return(0,u.openBlock)(),(0,u.createElementBlock)("input",{type:"hidden",name:"attractions[]",value:e},null,8,_)})),256)),(0,u.createVNode)(L.default,{id:"tour-month",label:(0,u.unref)(N.getLabelText)("tour_month","I'm traveling in"),"multiselect-label":"label",name:"when",options:(0,u.unref)(N.getLabelText)("months",(0,u.unref)(V.monthsEnglish)),placeholder:(0,u.unref)(N.getLabelText)("tour_month_placeholder","Select month"),"track-by":"value"},null,8,["label","options","placeholder"])])):(0,u.createCommentVNode)("",!0),(0,u.createVNode)(D.default,{class:"mt-6",variant:"dark"},{default:(0,u.withCtx)((function(){return[(0,u.createTextVNode)((0,u.toDisplayString)((0,u.unref)(N.getLabelText)("search","Search")),1)]})),_:1})],40,f)])])])])}}})},61309:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.monthsEnglish=t.baseUrl=t.paths=t.products=void 0,t.products=[{key:"accommodation",displayName:"Accommodation",optionValue:"acco"},{key:"eventsAndFestivals",displayName:"Events & Festivals",optionValue:"even"},{key:"foodAndDrink",displayName:"Food & Drink",optionValue:"cate"},{key:"thingsToDo",displayName:"Things to do",optionValue:"acti,attr,reta"},{key:"tours",displayName:"Tours",optionValue:"tour"}],t.paths={acco:"accommodation","acti,attr,reta":"see-do",cate:"food-drink",even:"events",tour:"tours"},t.baseUrl={dev:"http://172.28.81.65:8089",prod:"https://www.visitscotland.com"},t.monthsEnglish=[{label:"January",value:"january"},{label:"February",value:"february"},{label:"March",value:"march"},{label:"April",value:"april"},{label:"May",value:"may"},{label:"June",value:"june"},{label:"July",value:"july"},{label:"August",value:"august"},{label:"September",value:"september"},{label:"October",value:"october"},{label:"November",value:"november"},{label:"December",value:"december"}]},83506:function(e,t,a){"use strict";var n=a(25108),o=this&&this.__awaiter||function(e,t,a,n){return new(a||(a=Promise))((function(o,l){function r(e){try{c(n.next(e))}catch(e){l(e)}}function u(e){try{c(n.throw(e))}catch(e){l(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(r,u)}c((n=n.apply(e,t||[])).next())}))},l=this&&this.__generator||function(e,t){var a,n,o,l,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return l={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l;function u(u){return function(c){return function(u){if(a)throw new TypeError("Generator is already executing.");for(;l&&(l=0,u[0]&&(r=0)),r;)try{if(a=1,n&&(o=2&u[0]?n.return:u[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,u[1])).done)return o;switch(n=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,n=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(!((o=(o=r.trys).length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){r=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){r.label=u[1];break}if(6===u[0]&&r.label<o[1]){r.label=o[1],o=u;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(u);break}o[2]&&r.ops.pop(),r.trys.pop();continue}u=t.call(e,r)}catch(e){u=[6,e],n=0}finally{a=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getData=void 0;var u=r(a(97218));t.getData=function(e){return o(this,void 0,void 0,(function(){var t;return l(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,u.default.get(e)];case 1:return[2,a.sent().data];case 2:return t=a.sent(),n.error("Axios error: ".concat(t)),[3,3];case 3:return[2]}}))}))}},68504:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getProductTypes=t.getURLParameters=void 0;var n,o=a(61309);n="undefined"!=typeof window&&"object"==typeof window.VS?window.VS:{},t.getURLParameters=function(){var e=new URLSearchParams(document.location.search),t=Object.fromEntries(e);return"object"==typeof t&&Object.keys(t).forEach((function(e){return null===t[e]&&delete t[e]})),t},t.getProductTypes=function(){if(Object.keys(n).length<=0)return o.products;var e=n.search_config.basic_config.productTypes,t=[];return Object.keys(e).forEach((function(a){t.push({key:e[a].value,displayName:e[a].text,optionValue:e[a].value})})),t}},97809:function(e,t,a){"use strict";a.r(t);var n=a(65531),o={};for(var l in n)"default"!==l&&(o[l]=function(e){return n[e]}.bind(0,l));a.d(t,o),a(76633);const r=n.default;t.default=r},76633:function(e,t,a){"use strict";a(34156)},65531:function(e,t,a){"use strict";a.r(t),a.d(t,{default:function(){return o.a}});var n=a(43062),o=a.n(n),l={};for(var r in n)"default"!==r&&(l[r]=function(e){return n[e]}.bind(0,r));a.d(t,l)}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_visitscotland_component_library=self.webpackChunk_visitscotland_component_library||[]).push([[3810],{67106:function(e,t,r){var o=r(4942),n=r(67476),i=r(27447);function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?c(Object(r),!0).forEach((function(t){(0,o.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var u={computed:s(s({},(0,n.rn)(i.Z,{cookiesSet:function(e){return e.allowedCookies}})),{},{onetrustActiveGroups:function(){return window.OnetrustActiveGroups},requiredCookiesExist:function(){var e=this,t=!0;return this.requiredCookies?this.requiredCookies.forEach((function(r){-1===e.cookiesSet.indexOf(r)&&(t=!1)})):t=!1,t},cookiesInitStatus:function(){return void 0===this.onetrustActiveGroups||this.cookiesSet.length,!0}})};t.Z=u},16033:function(e,t){t.Z={youtube:["C0001","C0004"],languageSelector:["C0001"],embed:["C0001","C0003","C0004"],recaptcha:["C0001"],map:["C0001"]}}}]);
1
+ "use strict";(self.webpackChunk_visitscotland_component_library=self.webpackChunk_visitscotland_component_library||[]).push([[3810],{67106:function(e,t,r){var o=r(4942),n=r(67476),i=r(27447);function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?c(Object(r),!0).forEach((function(t){(0,o.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var s={computed:u(u({},(0,n.rn)(i.Z,{cookiesSet:function(e){return e.allowedCookies}})),{},{onetrustActiveGroups:function(){return"undefined"!=typeof window?window.OnetrustActiveGroups:null},requiredCookiesExist:function(){var e=this,t=!0;return this.requiredCookies?this.requiredCookies.forEach((function(r){-1===e.cookiesSet.indexOf(r)&&(t=!1)})):t=!1,t},cookiesInitStatus:function(){return void 0===this.onetrustActiveGroups||this.cookiesSet.length,!0}})};t.Z=s},16033:function(e,t){t.Z={youtube:["C0001","C0004"],languageSelector:["C0001"],embed:["C0001","C0003","C0004"],recaptcha:["C0001"],map:["C0001"]}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_visitscotland_component_library=self.webpackChunk_visitscotland_component_library||[]).push([[2147],{12147:function(e,n){var o;Object.defineProperty(n,"__esModule",{value:!0}),n.getLocale=n.getLabelText=void 0,o="undefined"!=typeof window&&"object"==typeof window.VS?window.VS:{},n.getLabelText=function(e,n,t){return Object.keys(o).length>0?void 0!==t?o.search_config.basic_config.search_module[t][e]:o.search_config.basic_config.search_module[e]:n},n.getLocale=function(){var e=document.documentElement.lang.toLocaleLowerCase().slice(0,2)||"";return"en"===e&&(e=""),e}}}]);
@@ -1 +1 @@
1
- "use strict";!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.VsCookieChecker=n():t.VsCookieChecker=n()}(self,(function(){return(self.webpackChunk_visitscotland_component_library=self.webpackChunk_visitscotland_component_library||[]).push([[4663],{49017:function(t,n,e){var o=e(15730),i=e(27447),r=e(48082),c=null;n.Z={data:function(){return{oneTrust:new r.Z,activeGroups:""}},watch:{activeGroups:function(){var t=this.activeGroups.split(",").filter((function(t){return""!==t}));c&&(c.setCookieArray(t),c.setTestRun(!0))}},mounted:function(){c=(0,i.Z)((0,o.Z)())},created:function(){this.checkOneTrust(),this.checkActiveGroups()},methods:{checkOneTrust:function(){var t=this;"undefined"!=typeof window&&this.oneTrust.checkThirdPartyLibrary("OneTrust",(function(){window.OneTrust.OnConsentChanged((function(){t.oneTrust.checkThirdPartyLibrary("OnetrustActiveGroups",(function(){t.activeGroups=window.OnetrustActiveGroups}))}))}))},checkActiveGroups:function(){var t=this;"undefined"!=typeof window&&this.oneTrust.checkThirdPartyLibrary("OnetrustActiveGroups",(function(){t.activeGroups=window.OnetrustActiveGroups}))}}}},2604:function(t,n,e){e.d(n,{s:function(){return r}});var o=e(66252),i={class:"d-none"};function r(t,n,e,r,c,s){return(0,o.wg)(),(0,o.iD)("span",i)}},94569:function(t,n){n.Z=function(){return Math.random().toString(36).substring(7)}},48082:function(t,n,e){e.d(n,{Z:function(){return a}});var o=e(43144),i=e(15671),r=e(4942),c=e(94569),s=e(25108),a=(0,o.Z)((function t(){var n=this;(0,i.Z)(this,t),(0,r.Z)(this,"init",(function(){window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach)})),(0,r.Z)(this,"instaOT",(function(t,e,o,i){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;s.log("insta");var c=n;n.checkThirdPartyLibrary("OneTrust",(function(){n.onetrustCookieCheck(t,(function(n){if(n)c.setIframeSrc();else if(i){s.log("fallback",o),s.log("container",i);var a=Array.from(o.classList)[0];i.length>1?i.forEach((function(n,s){i[s].querySelector(".".concat(a))||c.showOneTrustFallback(t,e,o,i[s],r)})):i.querySelector(".".concat(a))||c.showOneTrustFallback(t,e,o,i,r)}})),window.OneTrust.OnConsentChanged((function(){c.onetrustCookieCheck(t,(function(n){n&&(window.OneTrustEventBus.dispatchEvent("otCategory-approved"),c.hideOneTrustFallback(t),c.setIframeSrc())}))}))}))})),(0,r.Z)(this,"showOneTrustFallback",(function(t,e,o,i){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;s.log("showfallback");var a={visible:!1,fallback:o};if(a.visible)return!1;if(i.length>1&&a.fallback)s.log("aqui"),i.forEach((function(e){var o=a.fallback.cloneNode(!0);o.id=(0,c.Z)(),e.insertAdjacentHTML("afterend",o.outerHTML);var i=document.getElementById(o.id);i.style.display="block",a.visible=!0,o.classList.add("vscookies-".concat(t)),n.fallbacks.push({id:i.id,cat:t,visible:!0}),n.setFBButtonListener(o)}));else{s.log("aca");var u=a.fallback.cloneNode(!0);u.id=(0,c.Z)(),u.style.display="block",u.classList.add("vscookies-".concat(t)),r?i.insertBefore(u,i.childNodes[r]):i.appendChild(u),n.fallbacks.push({id:u.id,cat:t}),a.visible=!0,n.setFBButtonListener(u)}})),(0,r.Z)(this,"onetrustCookieCheck",(function(t,n){return n(window.OnetrustActiveGroups.includes(t))})),(0,r.Z)(this,"hideOneTrustFallback",(function(t){n.fallbacks.map((function(n){n.cat===t&&document.getElementById(n.id)&&(document.getElementById(n.id).style.display="none")}));var e=document.querySelectorAll(".vscookies-".concat(t));e.size>0&&e.map((function(t){t.style.display="none"}))})),(0,r.Z)(this,"checkThirdPartyLibrary",(function(t,e){var o=n;window.setTimeout((function(){window[t]?e(window[t]):o.checkThirdPartyLibrary(t,e)}),500)})),(0,r.Z)(this,"setFBButtonListener",(function(t){t.querySelector("#ot-sdk-btn").addEventListener("click",(function(){window.OneTrust.ToggleInfoDisplay()}))})),(0,r.Z)(this,"setIframeSrc",(function(){var t=document.querySelectorAll('iframe[data-src]:not([data-src=""])');t&&t.forEach((function(t){t.src=t.dataset.src,t.removeAttribute("data-src")}))})),this.fallbacks=[]}))},1312:function(t,n,e){e.r(n);var o=e(41723),i=e(62480);const r=(0,e(83744).Z)(i.Z,[["render",o.s]]);n.default=r},62480:function(t,n,e){e.d(n,{Z:function(){return o.Z}});var o=e(49017)},41723:function(t,n,e){e.d(n,{s:function(){return o.s}});var o=e(2604)}},function(t){return t.O(0,[6252,3744,9963,4942,6765,7169,8341,5730,7447],(function(){return 1312,t(t.s=1312)})),t.O()}])}));
1
+ "use strict";!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.VsCookieChecker=n():t.VsCookieChecker=n()}(self,(function(){return(self.webpackChunk_visitscotland_component_library=self.webpackChunk_visitscotland_component_library||[]).push([[4663],{49017:function(t,n,e){var o=e(15730),i=e(27447),r=e(48082),c=null;n.Z={data:function(){return{oneTrust:new r.Z,activeGroups:""}},watch:{activeGroups:function(){var t=this.activeGroups.split(",").filter((function(t){return""!==t}));c&&(c.setCookieArray(t),c.setTestRun(!0))}},mounted:function(){c=(0,i.Z)((0,o.Z)())},created:function(){this.checkOneTrust(),this.checkActiveGroups()},methods:{checkOneTrust:function(){var t=this;"undefined"!=typeof window&&this.oneTrust.checkThirdPartyLibrary("OneTrust",(function(){window.OneTrust.OnConsentChanged((function(){t.oneTrust.checkThirdPartyLibrary("OnetrustActiveGroups",(function(){t.activeGroups=window.OnetrustActiveGroups}))}))}))},checkActiveGroups:function(){var t=this;"undefined"!=typeof window&&this.oneTrust.checkThirdPartyLibrary("OnetrustActiveGroups",(function(){t.activeGroups=window.OnetrustActiveGroups}))}}}},2604:function(t,n,e){e.d(n,{s:function(){return r}});var o=e(66252),i={class:"d-none"};function r(t,n,e,r,c,s){return(0,o.wg)(),(0,o.iD)("span",i)}},94569:function(t,n){n.Z=function(){return Math.random().toString(36).substring(7)}},48082:function(t,n,e){e.d(n,{Z:function(){return a}});var o=e(43144),i=e(15671),r=e(4942),c=e(94569),s=e(25108),a=(0,o.Z)((function t(){var n=this;(0,i.Z)(this,t),(0,r.Z)(this,"init",(function(){window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach)})),(0,r.Z)(this,"instaOT",(function(t,e,o,i){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;s.log("insta");var c=n;n.checkThirdPartyLibrary("OneTrust",(function(){n.onetrustCookieCheck(t,(function(n){if(n)c.setIframeSrc();else if(i){s.log("fallback",o),s.log("container",i);var a=Array.from(o.classList)[0];i.length>1?i.forEach((function(n,s){i[s].querySelector(".".concat(a))||c.showOneTrustFallback(t,e,o,i[s],r)})):i.querySelector(".".concat(a))||c.showOneTrustFallback(t,e,o,i,r)}})),window.OneTrust.OnConsentChanged((function(){c.onetrustCookieCheck(t,(function(n){n&&(window.OneTrustEventBus.dispatchEvent("otCategory-approved"),c.hideOneTrustFallback(t),c.setIframeSrc())}))}))}))})),(0,r.Z)(this,"showOneTrustFallback",(function(t,e,o,i){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;s.log("showfallback");var a={visible:!1,fallback:o};if(a.visible)return!1;if(i.length>1&&a.fallback)s.log("aqui"),i.forEach((function(e){var o=a.fallback.cloneNode(!0);o.id=(0,c.Z)(),e.insertAdjacentHTML("afterend",o.outerHTML);var i=document.getElementById(o.id);i.style.display="block",a.visible=!0,o.classList.add("vscookies-".concat(t)),n.fallbacks.push({id:i.id,cat:t,visible:!0}),n.setFBButtonListener(o)}));else{s.log("aca");var u=a.fallback.cloneNode(!0);u.id=(0,c.Z)(),u.style.display="block",u.classList.add("vscookies-".concat(t)),r?i.insertBefore(u,i.childNodes[r]):i.appendChild(u),n.fallbacks.push({id:u.id,cat:t}),a.visible=!0,n.setFBButtonListener(u)}})),(0,r.Z)(this,"onetrustCookieCheck",(function(t,n){if("undefined"!=typeof window)return n(window.OnetrustActiveGroups.includes(t))})),(0,r.Z)(this,"hideOneTrustFallback",(function(t){n.fallbacks.map((function(n){n.cat===t&&document.getElementById(n.id)&&(document.getElementById(n.id).style.display="none")}));var e=document.querySelectorAll(".vscookies-".concat(t));e.size>0&&e.map((function(t){t.style.display="none"}))})),(0,r.Z)(this,"checkThirdPartyLibrary",(function(t,e){var o=n;window.setTimeout((function(){window[t]?e(window[t]):o.checkThirdPartyLibrary(t,e)}),500)})),(0,r.Z)(this,"setFBButtonListener",(function(t){t.querySelector("#ot-sdk-btn").addEventListener("click",(function(){window.OneTrust.ToggleInfoDisplay()}))})),(0,r.Z)(this,"setIframeSrc",(function(){var t=document.querySelectorAll('iframe[data-src]:not([data-src=""])');t&&t.forEach((function(t){t.src=t.dataset.src,t.removeAttribute("data-src")}))})),this.fallbacks=[]}))},1312:function(t,n,e){e.r(n);var o=e(41723),i=e(62480);const r=(0,e(83744).Z)(i.Z,[["render",o.s]]);n.default=r},62480:function(t,n,e){e.d(n,{Z:function(){return o.Z}});var o=e(49017)},41723:function(t,n,e){e.d(n,{s:function(){return o.s}});var o=e(2604)}},function(t){return t.O(0,[6252,3744,9963,4942,6765,7169,8341,5730,7447],(function(){return 1312,t(t.s=1312)})),t.O()}])}));