@visitscotland/component-library 5.16.2 → 5.16.3
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/dist/client/manifest.json +5 -5
- package/dist/client/scripts/2d88f58cdcc664b4b5bb.js +1 -0
- package/dist/client/scripts/ada624c5fa37983735da.js +1 -0
- package/dist/components/stores/federatedSearch.store.d.ts +4 -1
- package/dist/components/utils/federated-search/event-search.d.ts +1 -1
- package/dist/components/vs-component-library.js +29 -29
- package/dist/components/vs-component-library.mjs +292 -280
- package/dist/ssr/index.js +1 -1
- package/dist/ssr/manifest.json +1 -1
- package/package.json +1 -1
- package/dist/client/scripts/26f669c4aa66a8b5242f.js +0 -1
- package/dist/client/scripts/a983e6bbb115c3252875.js +0 -1
- /package/dist/client/styles/{26f669c4aa66a8b5242f.css → 2d88f58cdcc664b4b5bb.css} +0 -0
- /package/dist/ssr/styles/{6dfac11998b5ada85f1c.css → 85e3613d52f20afba6da.css} +0 -0
|
@@ -7263,7 +7263,7 @@
|
|
|
7263
7263
|
"scripts/732ec555c9d0c20ede00.js",
|
|
7264
7264
|
"scripts/e0a777194c85c718245b.js",
|
|
7265
7265
|
"scripts/2464bcc48b0bd7955c9f.js",
|
|
7266
|
-
"scripts/
|
|
7266
|
+
"scripts/ada624c5fa37983735da.js",
|
|
7267
7267
|
"scripts/8773147ebc61bee2e1a6.js",
|
|
7268
7268
|
"scripts/affc2dc765c1741a7319.js",
|
|
7269
7269
|
"scripts/f2ef165911bb1b115aad.js",
|
|
@@ -7542,7 +7542,7 @@
|
|
|
7542
7542
|
"scripts/507ccdc5bf81d59adfb1.js",
|
|
7543
7543
|
"scripts/59658d2a579def05efa0.js",
|
|
7544
7544
|
"scripts/17f706d9450b7e231610.js",
|
|
7545
|
-
"scripts/
|
|
7545
|
+
"scripts/ada624c5fa37983735da.js",
|
|
7546
7546
|
"scripts/2e638bf18671846cc500.js",
|
|
7547
7547
|
"scripts/891ca6d77a816816d620.js"
|
|
7548
7548
|
],
|
|
@@ -7688,7 +7688,7 @@
|
|
|
7688
7688
|
"scripts/732ec555c9d0c20ede00.js",
|
|
7689
7689
|
"scripts/e0a777194c85c718245b.js",
|
|
7690
7690
|
"scripts/2464bcc48b0bd7955c9f.js",
|
|
7691
|
-
"scripts/
|
|
7691
|
+
"scripts/ada624c5fa37983735da.js",
|
|
7692
7692
|
"scripts/8773147ebc61bee2e1a6.js",
|
|
7693
7693
|
"scripts/affc2dc765c1741a7319.js",
|
|
7694
7694
|
"scripts/f2ef165911bb1b115aad.js",
|
|
@@ -7773,7 +7773,7 @@
|
|
|
7773
7773
|
"scripts/13f11ddb02a309d7ca52.js",
|
|
7774
7774
|
"scripts/2e638bf18671846cc500.js",
|
|
7775
7775
|
"scripts/588b32ff5515fdd5707e.js",
|
|
7776
|
-
"scripts/
|
|
7776
|
+
"scripts/2d88f58cdcc664b4b5bb.js"
|
|
7777
7777
|
],
|
|
7778
7778
|
"styles": [
|
|
7779
7779
|
"styles/5ef9a0f18541fee55f4c.css",
|
|
@@ -7927,7 +7927,7 @@
|
|
|
7927
7927
|
"styles/13f11ddb02a309d7ca52.css",
|
|
7928
7928
|
"styles/2e638bf18671846cc500.css",
|
|
7929
7929
|
"styles/588b32ff5515fdd5707e.css",
|
|
7930
|
-
"styles/
|
|
7930
|
+
"styles/2d88f58cdcc664b4b5bb.css"
|
|
7931
7931
|
]
|
|
7932
7932
|
}
|
|
7933
7933
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.VsFederatedSearch=t():e.VsFederatedSearch=t()}(self,(function(){return(self.webpackChunk_visitscotland_component_library=self.webpackChunk_visitscotland_component_library||[]).push([[1746],{12927:function(e,t,a){"use strict";var r=a(85072),s=a.n(r),n=a(97825),o=a.n(n),l=a(77659),i=a.n(l),u=a(55056),d=a.n(u),c=a(10540),g=a.n(c),f=a(41113),p=a.n(f),v=a(57185),b=a.n(v),y={};y.styleTagTransform=p(),y.setAttributes=d(),y.insert=i().bind(null,"head"),y.domAPI=o(),y.insertStyleElement=g(),s()(b(),y),b()&&b().locals&&b().locals},39535:function(e,t,a){"use strict";a.d(t,{A:function(){return r.A}});var r=a(77891)},49439:function(e,t,a){"use strict";a.r(t);var r=a(39535);a(57595);const s=r.A;t.default=s},57185:function(){},57595:function(e,t,a){"use strict";a(12927)},77891:function(e,t,a){"use strict";var r=a(20641),s=a(50953),n=a(53751),o=a(90033),l=a(12903),i=a(45922),u=a.n(i),d=a(88620),c=a(1780),g=a(58995),f=a(35965),p={class:"vs-federated-search","data-test":"vs-federated-search"},v={class:"vs-federated-search__container"},b={key:0,class:"vs-federated-search__results"},y={key:2},m={class:"position-relative"},h={class:"position-absolute bottom-0 start-0 d-flex gap-2"},R={class:"position-absolute bottom-0 end-0 d-flex"},k={class:"truncate-3-lines"},C={class:"d-flex justify-content-end align-items-end mt-050"},L={key:0,class:"d-flex align-items-start flex-grow-1"},_={key:3,class:"vs-federated-search__warning"};t.A={__name:"FederatedSearch",props:{cludoApiKey:{type:String,default:(0,d.A)("CLUDO_API_KEY")},cludoCustomerId:{type:Number,default:Number((0,d.A)("CLUDO_CUSTOMER_ID"))},cludoEngineId:{type:Number,default:Number((0,d.A)("CLUDO_ENGINE_ID"))},eventsApi:{type:String,default:(0,d.A)("EVENTS_API_URL")},cludoCategories:{type:Array,default:void 0},subFilters:{type:Array,default:void 0},errorMessages:{type:Object,required:!0},fromText:{type:String,default:""},paginationLabels:{type:Object,required:!0},searchLabels:{type:Object,required:!0},sortLabels:{type:Object,required:!0},cardCategoryLabels:{type:Object,required:!0,default:function(){}},siteLanguage:{type:String,default:"en",validator:function(e){return e.match(/(en|es|it|de|nl|fr)/)}}},setup:function(e){var t=u()(),a=(0,s.KR)({message:"",error:!1}),i=e;(0,r.Gt)("cludoCategories",i.cludoCategories);var d=(0,r.EW)((function(){var e;return t.selectedCategoryKey?"events"!==t.selectedCategoryKey?e=Math.ceil(t.totalResultsCludo/12):"events"===t.selectedCategoryKey&&(e=Math.ceil(t.totalResultsEvents/12)):e=t.totalResultsCludo>=t.totalResultsEvents?Math.ceil(t.totalResultsCludo/6):Math.ceil(t.totalResultsEvents/6),e}));function D(){t.endDate&&t.startDate>t.endDate?(a.value.error=!0,a.value.message=i.errorMessages.incorrectDateOrder):"events"===t.selectedCategoryKey&&t.eventsApiError&&!t.isLoading?(a.value.error=!0,a.value.message=i.errorMessages.eventError):(t.searchTerm||t.selectedCategory)&&"events"!==t.selectedCategoryKey&&t.cludoError&&!t.isLoading?(a.value.error=!0,a.value.message=i.errorMessages.cludoError):0!==t.totalResults||t.isLoading?(a.value.error=!1,a.value.message=""):(a.value.error=!0,a.value.message=i.errorMessages.noResults)}function S(e){t.startDate=e,t.navigateToResultsPage(!0)}function E(e){t.endDate=e,t.navigateToResultsPage(!0)}function V(e){t.sortBy=e,t.navigateToResultsPage(!0)}function A(e){t.currentPage=e,"undefined"!=typeof window&&window.scrollTo({top:0,left:0,behavior:"smooth"}),t.navigateToResultsPage()}function I(e){if(e.url)return e.url;if(e.placeUrl)return e.placeUrl;var t=encodeURIComponent(e.title.replaceAll(" ","-").toLowerCase());return"".concat("https://www.datathistle.com/event/").concat(e.parentId,"-").concat(t)}return(0,r.sV)((function(){if(t.cludoCredentials={apiKey:i.cludoApiKey,customerId:i.cludoCustomerId,engineId:i.cludoEngineId},t.eventsApi=i.eventsApi,t.cludoCategories=i.cludoCategories,t.siteLanguage=i.siteLanguage,D(),"undefined"!=typeof window&&"undefined"!=typeof document){var e=new URLSearchParams(document.location.search),a=e.get("search-term"),r=parseInt(e.get("page"),10);r&&(t.currentPage=r),a&&(t.searchTerm=a,t.getSearchResults())}})),(0,r.$u)((function(){D()})),function(u,D){return(0,r.uX)(),(0,r.CE)("div",p,[(0,r.Lk)("div",v,[(0,r.bF)(g.default,{"cludo-api-key":i.cludoApiKey,"cludo-customer-id":i.cludoCustomerId,"cludo-engine-id":i.cludoEngineId,"sub-filters":i.subFilters,labels:i.searchLabels},null,8,["cludo-api-key","cludo-customer-id","cludo-engine-id","sub-filters","labels"]),(0,r.bF)(c.default,{class:"my-200"}),((0,r.uX)(!0),(0,r.CE)(r.FK,null,(0,r.pI)((0,s.R1)(t).cludoCategories,(function(e,a){return(0,r.bo)(((0,r.uX)(),(0,r.CE)("div",{key:a,class:"mb-200"},[(0,r.RG)(u.$slots,"federated-search__spotlight-".concat(e.Key))],512)),[[n.vShow,(0,s.R1)(t).selectedCategoryKey===e.Key]])})),128)),(0,s.R1)(t).results?((0,r.uX)(),(0,r.CE)("div",b,[(0,r.Lk)("div",null,[(0,r.bF)((0,s.R1)(l.VsHeading),{"heading-style":"heading-m",level:2,class:"my-0"},{default:(0,r.k6)((function(){return[(0,r.eW)((0,o.toDisplayString)(i.searchLabels.searchResults),1)]})),_:1}),0!==(0,s.R1)(t).totalResults?((0,r.uX)(),(0,r.Wv)((0,s.R1)(l.VsDetail),{key:0},{default:(0,r.k6)((function(){return[(0,r.eW)((0,o.toDisplayString)(i.searchLabels.resultsFirst)+" "+(0,o.toDisplayString)((0,s.R1)(t).totalResults)+" "+(0,o.toDisplayString)(i.searchLabels.resultsSecond),1)]})),_:1})):(0,r.Q3)("",!0)]),"events"===(0,s.R1)(t).selectedCategoryKey?((0,r.uX)(),(0,r.Wv)(f.default,{key:0,"date-filter-visible":!0,"sort-options":i.sortLabels.sortOptions,"from-date-label":i.sortLabels.dateFrom,"to-date-label":i.sortLabels.dateTo,"sort-label":i.sortLabels.sort,onFromDateUpdated:S,onEndDateUpdated:E,onSortOrderUpdated:V},null,8,["sort-options","from-date-label","to-date-label","sort-label"])):(0,r.Q3)("",!0)])):(0,r.Q3)("",!0),(0,s.R1)(t).isLoading?((0,r.uX)(),(0,r.Wv)((0,s.R1)(l.VsLoadingSpinner),{key:1})):(0,r.Q3)("",!0),(0,s.R1)(t).isLoading||!(0,s.R1)(t).results||(0,s.R1)(t).eventsApiError?(0,r.Q3)("",!0):((0,r.uX)(),(0,r.CE)("div",y,[(0,r.bF)((0,s.R1)(l.VsCardGroup),{"cards-per-row":3,class:(0,o.normalizeClass)((0,s.R1)(t).results&&d.value<=1?"mb-300":null)},{default:(0,r.k6)((function(){return[((0,r.uX)(!0),(0,r.CE)(r.FK,null,(0,r.pI)((0,s.R1)(t).results,(function(t){return(0,r.uX)(),(0,r.Wv)((0,s.R1)(l.VsCard),{key:t.id},{"vs-card-header":(0,r.k6)((function(){return[(0,r.Lk)("div",m,[(0,r.bF)((0,s.R1)(l.VsImg),{src:t.imgSrc||"https://static.visitscotland.com/img/fallback-img.png",class:"w-100 aspect-ratio-3-2 rounded-1 object-fit-cover img-zoom-on-hover"},null,8,["src"]),(0,r.Lk)("div",h,[t.minPrice?((0,r.uX)(),(0,r.Wv)((0,s.R1)(l.VsBadge),{key:0,variant:"information",class:"rounded-top-end rounded-bottom-start"},{default:(0,r.k6)((function(){return[(0,r.eW)((0,o.toDisplayString)(i.fromText)+" "+(0,o.toDisplayString)((e=t.minPrice,null===e?"":e.match(/\b\d+\.\d\b/)?"£".concat(e,"0"):"£".concat(e))),1)];var e})),_:2},1024)):(0,r.Q3)("",!0),t.startDate?((0,r.uX)(),(0,r.Wv)((0,s.R1)(l.VsBadge),{key:1,variant:"information",class:"rounded-top-end rounded-top-start"},{default:(0,r.k6)((function(){return[(0,r.eW)((0,o.toDisplayString)((e=t.startDate,a=t.endDate,e===a?e:"".concat(e," - ").concat(a))),1)];var e,a})),_:2},1024)):(0,r.Q3)("",!0)]),(0,r.Lk)("div",R,[t.categoryCard&&e.cardCategoryLabels[t.categoryCard]?((0,r.uX)(),(0,r.Wv)((0,s.R1)(l.VsBadge),{key:0,variant:"highlight",class:"rounded-top-start rounded-bottom-start mx-0"},{default:(0,r.k6)((function(){return[(0,r.eW)((0,o.toDisplayString)(e.cardCategoryLabels[t.categoryCard]),1)]})),_:2},1024)):(0,r.Q3)("",!0)])])]})),"vs-card-body":(0,r.k6)((function(){return[(0,r.bF)((0,s.R1)(l.VsHeading),{level:"3","heading-style":"heading-xs"},{default:(0,r.k6)((function(){return[(0,r.bF)((0,s.R1)(l.VsLink),{href:I(t),class:"stretched-link",variant:"secondary"},{default:(0,r.k6)((function(){return[(0,r.eW)((0,o.toDisplayString)(t.title),1)]})),_:2},1032,["href"])]})),_:2},1024),(0,r.bF)((0,s.R1)(l.VsBody),null,{default:(0,r.k6)((function(){return[(0,r.Lk)("p",k,(0,o.toDisplayString)(t.description),1)]})),_:2},1024)]})),"vs-card-footer":(0,r.k6)((function(){return[(0,r.Lk)("div",C,[t.location?((0,r.uX)(),(0,r.CE)("div",L,[(0,r.bF)((0,s.R1)(l.VsIcon),{icon:"fa-solid fa-location-dot",variant:"highlight",class:"me-050",size:"sm"}),(0,r.bF)((0,s.R1)(l.VsDetail),{"no-margins":"",color:"tertiary"},{default:(0,r.k6)((function(){return[(0,r.eW)((0,o.toDisplayString)(t.location),1)]})),_:2},1024)])):(0,r.Q3)("",!0),(0,r.Lk)("div",null,["data-thistle"===t.dataSrc?((0,r.uX)(),(0,r.Wv)((0,s.R1)(l.VsIcon),{key:0,icon:"vs-icon-control-external-link",variant:"highlight",size:"sm"})):(0,r.Q3)("",!0)])])]})),_:2},1024)})),128))]})),_:1},8,["class"]),(0,s.R1)(t).results&&d.value>1?((0,r.uX)(),(0,r.Wv)((0,s.R1)(l.VsPagination),{key:0,class:"vs-federated-search__pagination","number-of-pages":d.value,"next-button-label":i.paginationLabels.nextButtonLabel,"previous-button-label":i.paginationLabels.previousButtonLabel,"page-label":i.paginationLabels.pageLabel,"of-label":i.paginationLabels.ofLabel,modelValue:(0,s.R1)(t).currentPage,"onUpdate:modelValue":D[0]||(D[0]=function(e){return(0,s.R1)(t).currentPage=e}),onPageClick:A},null,8,["number-of-pages","next-button-label","previous-button-label","page-label","of-label","modelValue"])):(0,r.Q3)("",!0)])),a.value.error?((0,r.uX)(),(0,r.CE)("div",_,[a.value.error?((0,r.uX)(),(0,r.Wv)((0,s.R1)(l.VsWarning),{key:0},{default:(0,r.k6)((function(){return[(0,r.eW)((0,o.toDisplayString)(a.value.message),1)]})),_:1})):(0,r.Q3)("",!0)])):(0,r.Q3)("",!0)]),(0,r.bF)((0,s.R1)(l.VsWarning),{"data-test":"vs-federated-search__error--no-js",class:"vs-federated-search__error--no-js"},{default:(0,r.k6)((function(){return[(0,r.eW)((0,o.toDisplayString)(i.searchLabels.noJs),1)]})),_:1})])}}}}},function(e){return e.O(0,[641,6262,7510,3751,4352,4467,7527,8086,810,7800,9394,2543,3453,281,7536,7511,9033,8795,6425,7171,3498,8449,4982,6422,8745,8836,8638,2368,3838,7521,1438,4580,5676,1574,9122,4282,1459,5921,2142,5025,7957,9116,7275,4448,9810,8896,3486,378,6494,1244,1688,6216,1454,2491,4900,4360,6305,9856,8861,630,4179,7933,2710,3706,3614,3484,1371,9054,7553,6086,3130,5945,8167,4921,1288,3990,3293,680,4828,459,2329,4409,6358,1696,80,2152,4145,922,4433,2822,8258,1086,1154,8533,4681,71,7033,7894,6665,6618,1389,1161,9621,4029,3350,9146,6838,4879,4953,1718,1120,47,9464,9177,5922,9839,625,6004,5513,7097,7311,8399,5465,6641,9633,555,5809,3337,2810,7086,3603,8978,3033,6649,5807,4712,5048,2761,8693,5782,8407,4562,7906,1841,6175,3642,7692,8462,7231,7195,8573,1106,1379,4999,4232,6431,3609,2759,7848,6241,8817,8570,815,4061,9323,9923,3731,2837,3914,5577,3650,2612,6283,9783,7969,9280,4036,8332,2437,6123,7570,4670,9423,9886,3734,1901,8969,5106,627,538,1493,4297,1474,4856,7006,6689,8995,5965,1780],(function(){return e(e.s=49439)})),e.O()}])}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_visitscotland_component_library=self.webpackChunk_visitscotland_component_library||[]).push([[5922],{45922:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(a,o){function u(e){try{l(n.next(e))}catch(e){o(e)}}function c(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(u,c)}l((n=n.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var r,n,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},u=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return u.next=c(0),u.throw=c(1),u.return=c(2),"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function c(c){return function(l){return function(c){if(r)throw new TypeError("Generator is already executing.");for(;u&&(u=0,c[0]&&(o=0)),o;)try{if(r=1,n&&(a=2&c[0]?n.return:c[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,c[1])).done)return a;switch(n=0,a&&(c=[2&c[0],a.value]),c[0]){case 0:case 1:a=c;break;case 4:return o.label++,{value:c[1],done:!1};case 5:o.label++,n=c[1],c=[0];continue;case 7:c=o.ops.pop(),o.trys.pop();continue;default:if(!((a=(a=o.trys).length>0&&a[a.length-1])||6!==c[0]&&2!==c[0])){o=0;continue}if(3===c[0]&&(!a||c[1]>a[0]&&c[1]<a[3])){o.label=c[1];break}if(6===c[0]&&o.label<a[1]){o.label=a[1],a=c;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(c);break}a[2]&&o.ops.pop(),o.trys.pop();continue}c=t.call(e,o)}catch(e){c=[6,e],n=0}finally{r=a=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,l])}}},o=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,a=0,o=t.length;a<o;a++)!n&&a in t||(n||(n=Array.prototype.slice.call(t,0,a)),n[a]=t[a]);return e.concat(n||Array.prototype.slice.call(t))},u=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var c=r(17527),l=r(48086),s=u(r(80358)),i=u(r(84843)),f=u(r(46842)),d=(0,l.defineStore)("federatedSearch",(function(){var e=(0,c.ref)(null),t=(0,c.ref)(void 0),r=(0,c.ref)(!1),u=(0,c.ref)(1),l=(0,c.ref)(void 0),d=(0,c.ref)(!1),p=(0,c.ref)(!1),h=(0,c.ref)(null),v=(0,c.ref)(""),y=(0,c.ref)(null),b=(0,c.ref)(null),g=(0,c.ref)([]),w=(0,c.ref)([]),m=(0,c.ref)(void 0),_=(0,c.ref)(void 0),P=(0,c.ref)(void 0),S=(0,c.ref)(!1),k=(0,c.ref)(""),E=(0,c.ref)(""),x=(0,c.ref)(void 0),C=(0,c.ref)(void 0),R=(0,c.ref)(void 0);function j(){return n(this,void 0,void 0,(function(){var e,r;return a(this,(function(n){switch(n.label){case 0:return p.value=!0,[4,(0,s.default)(v.value,t.value,u.value,y.value,b.value)];case 1:return e=n.sent(),[4,(0,i.default)(l.value,v.value,u.value,b.value,w.value,k.value,E.value,x.value,R.value)];case 2:return r=n.sent(),h.value=o(o([],e.results,!0),r.results,!0),_.value=e.totalResults,P.value=r.totalResults,m.value=e.totalResults+r.totalResults,p.value=!1,[2]}}))}))}return{cludoCategories:e,currentPage:u,cludoCredentials:t,cludoError:r,eventsApi:l,eventsApiError:d,getAutoComplete:function(){return n(this,void 0,void 0,(function(){return a(this,(function(e){return[2,(0,f.default)(v.value,t.value)]}))}))},getSearchResults:j,isLoading:p,results:h,searchTerm:v,selectedCategory:y,selectedCategoryKey:b,selectedSubCategory:g,selectedSubCategoryKey:w,totalResults:m,totalResultsCludo:_,totalResultsEvents:P,navigateToResultsPage:function(e){var t=new URL(window.location.href);if(v.value?t.searchParams.set("search-term",v.value):t.searchParams.delete("search-term"),b.value?t.searchParams.set("category",encodeURIComponent(b.value)):t.searchParams.delete("category"),w.value.length>0?t.searchParams.set("sub-category",encodeURIComponent(w.value.join(","))):t.searchParams.delete("sub-category"),e?(u.value=1,t.searchParams.set("page",u.value.toString())):u.value&&u.value>1?t.searchParams.set("page",u.value.toString()):t.searchParams.delete("page"),k.value?t.searchParams.set("start-date",k.value):t.searchParams.delete("start-date"),E.value?t.searchParams.set("end-date",E.value):t.searchParams.delete("end-date"),x.value?t.searchParams.set("sort-by",x.value):t.searchParams.delete("sort-by"),S.value){var r="./".concat(C.value,"/").concat(t.search);window.location.href=r}else window.history.pushState({},"",t),j()},isHomePage:S,startDate:k,endDate:E,sortBy:x,siteLanguage:R}}));t.default=d},46842:function(e,t){var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(a,o){function u(e){try{l(n.next(e))}catch(e){o(e)}}function c(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(u,c)}l((n=n.apply(e,t||[])).next())}))},n=this&&this.__generator||function(e,t){var r,n,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},u=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return u.next=c(0),u.throw=c(1),u.return=c(2),"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function c(c){return function(l){return function(c){if(r)throw new TypeError("Generator is already executing.");for(;u&&(u=0,c[0]&&(o=0)),o;)try{if(r=1,n&&(a=2&c[0]?n.return:c[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,c[1])).done)return a;switch(n=0,a&&(c=[2&c[0],a.value]),c[0]){case 0:case 1:a=c;break;case 4:return o.label++,{value:c[1],done:!1};case 5:o.label++,n=c[1],c=[0];continue;case 7:c=o.ops.pop(),o.trys.pop();continue;default:if(!((a=(a=o.trys).length>0&&a[a.length-1])||6!==c[0]&&2!==c[0])){o=0;continue}if(3===c[0]&&(!a||c[1]>a[0]&&c[1]<a[3])){o.label=c[1];break}if(6===c[0]&&o.label<a[1]){o.label=a[1],a=c;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(c);break}a[2]&&o.ops.pop(),o.trys.pop();continue}c=t.call(e,o)}catch(e){c=[6,e],n=0}finally{r=a=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,l])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return r(this,void 0,void 0,(function(){var r,a,o,u,c,l,s;return n(this,(function(n){switch(n.label){case 0:r=t.apiKey,a=t.customerId,o=t.engineId,u="".concat("https://api-eu1.cludo.com/api/v3","/").concat(a,"/").concat(o,"/Autocomplete"),c="".concat(a,":").concat(r),n.label=1;case 1:return n.trys.push([1,4,,5]),[4,fetch(u,{method:"POST",body:JSON.stringify({text:e}),headers:{"Content-Type":"application/json",Authorization:"Basic ".concat(btoa(c))}})];case 2:if(!(l=n.sent()).ok)throw new Error("Autocomplete search error ".concat(l.status));return[4,l.json()];case 3:return[2,n.sent()];case 4:throw s=n.sent(),new Error("Autocomplete search error: ".concat(s));case 5:return[2]}}))}))}},80358:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(a,o){function u(e){try{l(n.next(e))}catch(e){o(e)}}function c(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(u,c)}l((n=n.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var r,n,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},u=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return u.next=c(0),u.throw=c(1),u.return=c(2),"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function c(c){return function(l){return function(c){if(r)throw new TypeError("Generator is already executing.");for(;u&&(u=0,c[0]&&(o=0)),o;)try{if(r=1,n&&(a=2&c[0]?n.return:c[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,c[1])).done)return a;switch(n=0,a&&(c=[2&c[0],a.value]),c[0]){case 0:case 1:a=c;break;case 4:return o.label++,{value:c[1],done:!1};case 5:o.label++,n=c[1],c=[0];continue;case 7:c=o.ops.pop(),o.trys.pop();continue;default:if(!((a=(a=o.trys).length>0&&a[a.length-1])||6!==c[0]&&2!==c[0])){o=0;continue}if(3===c[0]&&(!a||c[1]>a[0]&&c[1]<a[3])){o.label=c[1];break}if(6===c[0]&&o.label<a[1]){o.label=a[1],a=c;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(c);break}a[2]&&o.ops.pop(),o.trys.pop();continue}c=t.call(e,o)}catch(e){c=[6,e],n=0}finally{r=a=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,l])}}},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var u=o(r(45922));t.default=function(e,t,r,o,c){return n(this,void 0,void 0,(function(){var n,o,l,s,i,f,d,p,h;return a(this,(function(a){switch(a.label){case 0:if(n=t.apiKey,o=t.customerId,l=t.engineId,s="https://api-eu1.cludo.com/api/v3/".concat(o,"/").concat(l,"/search"),i="".concat(o,":").concat(n),(f=(0,u.default)()).eventsApiError=!1,f.cludoError=!1,!t)return f.cludoError=!0,f.isLoading=!1,[2,{results:[],totalResults:0}];if("events"===c)return[2,{results:[],totalResults:0}];a.label=1;case 1:return a.trys.push([1,4,,5]),[4,fetch(s,{method:"POST",body:JSON.stringify({query:e||"*",operator:"or",responseType:"JsonObject",perPage:c?12:6,page:r,facets:{Category:c?[c]:null}}),headers:{"Content-Type":"application/json",Authorization:"Basic ".concat(btoa(i))}})];case 2:if(!(d=a.sent()).ok)throw f.cludoError=!0,f.isLoading=!1,new Error("Cludo response message: ".concat(d.status));return[4,d.json()];case 3:return p=a.sent(),h=p.TypedDocuments.map((function(e){var t;return{id:e.Fields.Id.Value||"",title:e.Fields.Title.Value||"",description:e.Fields.Description.Value||"",imgSrc:(null===(t=e.Fields.Image)||void 0===t?void 0:t.Value)||"",url:e.Fields.Url.Value||"",dataSrc:"cludo",categoryCard:e.Fields.categoryCard.Value||""}})),[2,{results:h,totalResults:p.TotalDocument}];case 4:return a.sent(),f.cludoError=!0,f.isLoading=!1,[2,{results:[],totalResults:0}];case 5:return[2]}}))}))}},84843:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(a,o){function u(e){try{l(n.next(e))}catch(e){o(e)}}function c(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(u,c)}l((n=n.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var r,n,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},u=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return u.next=c(0),u.throw=c(1),u.return=c(2),"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function c(c){return function(l){return function(c){if(r)throw new TypeError("Generator is already executing.");for(;u&&(u=0,c[0]&&(o=0)),o;)try{if(r=1,n&&(a=2&c[0]?n.return:c[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,c[1])).done)return a;switch(n=0,a&&(c=[2&c[0],a.value]),c[0]){case 0:case 1:a=c;break;case 4:return o.label++,{value:c[1],done:!1};case 5:o.label++,n=c[1],c=[0];continue;case 7:c=o.ops.pop(),o.trys.pop();continue;default:if(!((a=(a=o.trys).length>0&&a[a.length-1])||6!==c[0]&&2!==c[0])){o=0;continue}if(3===c[0]&&(!a||c[1]>a[0]&&c[1]<a[3])){o.label=c[1];break}if(6===c[0]&&o.label<a[1]){o.label=a[1],a=c;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(c);break}a[2]&&o.ops.pop(),o.trys.pop();continue}c=t.call(e,o)}catch(e){c=[6,e],n=0}finally{r=a=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,l])}}},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var u=o(r(45922));t.default=function(e,t,r,o,c,l,s,i,f){return n(this,void 0,void 0,(function(){var n,d,p,h;return a(this,(function(a){switch(a.label){case 0:if((n=(0,u.default)()).eventsApiError=!1,n.cludoError=!1,"events"!==o&&o)return[3,6];d="".concat(e,"?query=").concat(t,"&lang=").concat(f),d=r>1?"".concat(d,"&page=").concat(r):d,d=""!==l?"".concat(d,"&startDate=").concat(l):d,d=""!==s?"".concat(d,"&endDate=").concat(s):d,d=i?"".concat(d,"&sort=").concat(i):d,d="".concat(d,"events"===o?"&pageSize=12":"&pageSize=6"),c.forEach((function(e){d+="&category=".concat(e)})),a.label=1;case 1:return a.trys.push([1,4,,5]),[4,fetch(d)];case 2:if(!(p=a.sent()).ok)throw n.isLoading=!1,n.eventsApiError=!0,new Error("Events response message: ".concat(p.status));return[4,p.json()];case 3:return[2,{results:(v=h=a.sent(),v.events.map((function(e){var t,r,n,a,o,u,c;return{id:e.id,parentId:e.parentId,title:e.name,description:(null===(r=null===(t=e.descriptions)||void 0===t?void 0:t[0])||void 0===r?void 0:r.description)||"",imgSrc:(null===(a=null===(n=e.images)||void 0===n?void 0:n[0])||void 0===a?void 0:a.url)||"",url:(null===(u=null===(o=e.performances)||void 0===o?void 0:o[0])||void 0===u?void 0:u.url)||"",placeUrl:e.place.website,location:e.place.town,startDate:e.startFormatted,endDate:e.endFormatted,minPrice:null===(c=e.minPrice)||void 0===c?void 0:c.toString(),dataSrc:"data-thistle",categoryCard:e.categoryCard||""}}))),totalResults:h.totalResults}];case 4:return a.sent(),n.isLoading=!1,n.eventsApiError=!0,[2,{results:[],totalResults:0}];case 5:return[3,7];case 6:return[2,{results:[],totalResults:0}];case 7:return[2]}var v}))}))}}}]);
|
|
@@ -32,7 +32,8 @@ declare const useFederatedSearchStore: import('pinia').StoreDefinition<"federate
|
|
|
32
32
|
startDate: import('vue').Ref<string, string>;
|
|
33
33
|
endDate: import('vue').Ref<string, string>;
|
|
34
34
|
sortBy: import('vue').Ref<any, any>;
|
|
35
|
-
|
|
35
|
+
siteLanguage: import('vue').Ref<any, any>;
|
|
36
|
+
}, "currentPage" | "isHomePage" | "selectedSubCategory" | "isLoading" | "selectedCategory" | "searchTerm" | "endDate" | "startDate" | "cludoCategories" | "cludoCredentials" | "cludoError" | "eventsApi" | "eventsApiError" | "results" | "selectedCategoryKey" | "selectedSubCategoryKey" | "totalResults" | "totalResultsCludo" | "totalResultsEvents" | "sortBy" | "siteLanguage">, Pick<{
|
|
36
37
|
cludoCategories: import('vue').Ref<any, any>;
|
|
37
38
|
currentPage: import('vue').Ref<number, number>;
|
|
38
39
|
cludoCredentials: import('vue').Ref<{
|
|
@@ -64,6 +65,7 @@ declare const useFederatedSearchStore: import('pinia').StoreDefinition<"federate
|
|
|
64
65
|
startDate: import('vue').Ref<string, string>;
|
|
65
66
|
endDate: import('vue').Ref<string, string>;
|
|
66
67
|
sortBy: import('vue').Ref<any, any>;
|
|
68
|
+
siteLanguage: import('vue').Ref<any, any>;
|
|
67
69
|
}, never>, Pick<{
|
|
68
70
|
cludoCategories: import('vue').Ref<any, any>;
|
|
69
71
|
currentPage: import('vue').Ref<number, number>;
|
|
@@ -96,5 +98,6 @@ declare const useFederatedSearchStore: import('pinia').StoreDefinition<"federate
|
|
|
96
98
|
startDate: import('vue').Ref<string, string>;
|
|
97
99
|
endDate: import('vue').Ref<string, string>;
|
|
98
100
|
sortBy: import('vue').Ref<any, any>;
|
|
101
|
+
siteLanguage: import('vue').Ref<any, any>;
|
|
99
102
|
}, "getAutoComplete" | "getSearchResults" | "navigateToResultsPage">>;
|
|
100
103
|
export default useFederatedSearchStore;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FederatedSearchResult } from '../../types/types';
|
|
2
2
|
|
|
3
|
-
declare function eventSearch(api: string, searchTerm: string, page: number, selectedCategoryKey: string, selectedSubCategoryKey: string[], startDate: string, endDate: string, sortBy: string): Promise<{
|
|
3
|
+
declare function eventSearch(api: string, searchTerm: string, page: number, selectedCategoryKey: string, selectedSubCategoryKey: string[], startDate: string, endDate: string, sortBy: string, siteLanguage: string): Promise<{
|
|
4
4
|
results: FederatedSearchResult[];
|
|
5
5
|
totalResults: any;
|
|
6
6
|
}>;
|