Si è verificato un errore nell'elaborarazione del modello.
The following has evaluated to null or missing:
==> response.data.docs.getJSONObject(0)  [in template "3572636#3572671#4340004" at line 28, column 24]

----
Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??
----

----
FTL stack trace ("~" means nesting-related):
	- Failed at: #assign doc = response.data.docs.getJ...  [in template "3572636#3572671#4340004" at line 28, column 9]
----
1<#import "_TEMPLATE_CONTEXT_/3572636/3574130/23609/3793037" as d40> 
2 
3<#setting url_escaping_charset="UTF-8"> 
4 
5<#assign 
6    PUTIL = objectUtil("com.liferay.portal.kernel.util.PortalUtil") 
7    uuid = themeDisplay.getURLCurrent()?keep_after("-/c/n/")?keep_before("?")?keep_after_last("_") 
8    langId = locale?keep_before("_") 
9    contentType = "poi" 
10    vueActions = "" 
11    doc = "" 
12    lat = "0" 
13    lng = "0" 
14    hasCoords = false 
15/> 
16 
17<#-- <#assign z=request.setAttribute("ogTitle","title")> 
18<#assign z=request.setAttribute("ogImage","imgg")> 
19<#assign z=request.setAttribute("ogDesc","desc")> --> 
20 
21<#assign currentUrl = themeDisplay.getPortalURL() + themeDisplay.getURLCurrent() /> 
22<#assign z=request.setAttribute("ogUrl","${currentUrl}")> 
23 
24<#if uuid?has_content> 
25    <#assign response = d40.fetchData("https://guestapp.d40.it/v1/search/apt-trento/${contentType}/?uuid=${uuid}")> 
26     
27    <#if !response.error && response.data.docs?has_content> 
28        <#assign doc = response.data.docs.getJSONObject(0)> 
29         
30        ${request.session.removeAttribute("circularCategories")} 
31        ${request.session.setAttribute("circularCategories", doc.details.assetCategoryIds)} 
32    </#if> 
33</#if> 
34 
35<#if doc?has_content> 
36    <#if doc.details?? && doc.details.name[langId]?has_content> 
37        ${PUTIL.setPageTitle(doc.details.name[langId], request)} 
38    </#if> 
39     
40    <#assign vueActions = "getFavorites();"> 
41     
42    <#if doc.details.location.geoCoords.lat?has_content && doc.details.location.geoCoords.lon?has_content> 
43        <#assign 
44            hasCoords = true 
45            lat = doc.details.location.geoCoords.lat 
46            lng = doc.details.location.geoCoords.lon 
47            vueActions = "getFavorites();buildMap(${lat}, ${lng})" 
48        /> 
49    </#if> 
50</#if> 
51 
52<style> 
53    .swiper-button-next:after{ 
54        content: ""; 
55
56    .swiper-button-prev:after{ 
57        content: ""; 
58
59    .bg-darkgray{ 
60        background-color: #e5e5e5 !important; 
61
62    .min-h-12{ 
63        min-height: 3rem; 
64
65    .-ml-5{ 
66        margin-left: -5%; 
67
68</style> 
69 
70<div v-scope id="${d40.portletNamespace}" @vue:mounted="${vueActions}" v-cloak> 
71    <#if doc?has_content> 
72        <#if themeDisplay.getLayout().getAncestors()?has_content> 
73            <section id="breadcrumb" class="z-15 mt-25"> 
74                <div class="container"> 
75                    <ol class="breadcrumb flex lg:justify-center"> 
76                        <li class="pl-1 text-sm mr-2 relative">${d40.getLabel("sei_in")}:</li> 
77                         
78                        <li class="breadcrumb-item"> 
79                            <a href="/" class="breadcrumb-link" title="Home"> 
80                                <span class="breadcrumb-text-truncate text-dark underline">Home</span> 
81                            </a> 
82                        </li> 
83                         
84                        <#list themeDisplay.getLayout().getAncestors()?reverse as ancestor> 
85                            <li class="breadcrumb-item"> 
86                                <a href="${ancestor.getFriendlyURL()}" class="breadcrumb-link" title="${d40.escape(ancestor.getHTMLTitle(locale))}"> 
87                                    <span class="breadcrumb-text-truncate text-dark underline"> 
88                                        ${d40.escape(ancestor.getHTMLTitle(locale))} 
89                                    </span> 
90                                </a> 
91                            </li> 
92                        </#list> 
93                         
94                        <li class="breadcrumb-item active"> 
95                            <span class="breadcrumb-text-truncate text-dark"> 
96                                ${doc.details.name[langId]} 
97                            </span> 
98                        </li> 
99                    </ol> 
100                </div> 
101            </section> 
102        </#if> 
103         
104        <section class="relative mt-20"> 
105            <div class="container"> 
106                <div class="row"> 
107                    <div class="col-12 col-lg-7"> 
108                        <div class="card-row flex-col lg:flex-row mb-10"> 
109                            <div class="autofit-col autofit-col-expand order-2 lg:order-1"> 
110                                <div class="autofit-section"> 
111                                    <p class="text-dark font-semibold font-heading text-3xl lg:text-4xl uppercase"> 
112                                        ${doc.details.name[langId]} 
113                                        <#assign z=request.setAttribute("ogTitle","${doc.details.name[langId]}")> 
114                                    </p> 
115                                </div> 
116                            </div> 
117                            <div class="autofit-col justify-start order-1 lg:order-2 mb-3 lg:mb-0"> 
118                                <div class="autofit-section"> 
119                                    <div class="flex space-x-4"> 
120                                        <button type="button" v-if="isFavorite('${doc.uuid}')" @click="removeFavorite($event, '${doc.uuid}')" class="btn btn-link px-2"> 
121                                            <i class="fas fa-heart text-dark fa-2x"></i> 
122                                        </button> 
123                                        <button type="button" v-else @click="setFavorite($event, {id: '${doc.uuid}', contentJSON: {title: '${doc.details.name[langId]?js_string}', previewDescription: '', description: '', geoRef: '', previewPicture: '${d40.getDTNPreview(doc)}', viewUrl: '${d40.getDTNUrl(doc.details.name[langId], doc.uuid, contentType)}'}})" class="btn btn-link px-2"> 
124                                            <i class="fal fa-heart text-dark fa-2x"></i> 
125                                        </button> 
126                                         
127                                        <button type="button" @click="share('${doc.details.name[langId]}', '')" class="btn btn-link px-2"> 
128                                            <i class="fas fa-share-alt text-dark fa-2x"></i> 
129                                        </button> 
130                                    </div> 
131                                </div> 
132                            </div> 
133                        </div> 
134                         
135                        <#if doc.timetables.timeDescription[langId]?has_content> 
136                            <div class="text-dark text-lg font-light mb-15 mt-5"> 
137                                ${doc.timetables.timeDescription[langId]} 
138                            </div> 
139                        </#if> 
140                         
141                        <#if doc.details.description[langId]?has_content> 
142                            <div class="underline-grow text-dark font-light lg:text-lg leading-loose"> 
143                                ${doc.details.description[langId]} 
144                                 
145                                <#if doc.details.description[langId]?length lt 160> 
146                                    <#assign  
147                                        z=request.setAttribute("ogDesc","${htmlUtil.stripHtml(doc.details.description[langId])}") 
148                                    /> 
149                                <#else> 
150                                    <#assign  
151                                        z=request.setAttribute("ogDesc","${htmlUtil.stripHtml(doc.details.description[langId])?substring(0,160)}") 
152                                    /> 
153                                </#if> 
154                            </div> 
155                        </#if> 
156                    </div> 
157                     
158                    <div class="xl:absolute col-12 col-lg-5 xl:max-w-xl lg:right-0"> 
159                        <div class="bg-light"> 
160                            <div class="card-body px-5 pt-5 lg:px-10 lg:pt-10 pb-0"> 
161                                <p class="text-dark font-bold uppercase text-lg mb-0"> 
162                                    ${d40.getLabel("informazioni_contatti")} 
163                                </p> 
164                                <#if doc.details.townLabel != "{}"> 
165                                    <p class="text-dark text-lg mb-0"> 
166                                        ${d40.getLabel("localita")}: <span class="text-capitalize">${doc.details.townLabel[langId]}</span> 
167                                    </p> 
168                                </#if> 
169                                <#if doc.timetables.time_infos?has_content> 
170                                    <p class="text-dark font-bold text-lg mb-0 mt-3"> 
171                                        ${d40.getLabel("date_apertura")} 
172                                    </p> 
173                                </#if> 
174                            </div> 
175                             
176                            <#if doc.timetables.time_infos?has_content> 
177                                <div class="flex min-h-12"> 
178                                    <details class="bg-darkgray w-full lg:w-105% right-0 -ml-5"> 
179                                        <summary class="btn btn-link text-dark no-underline my-1 ml-12"> 
180                                            <i class="fal fa-calendar-alt"></i> 
181                                            <span>${doc.timetables.time_infos.getJSONObject(0).date_from} - ${doc.timetables.time_infos.getJSONObject(0).time_from} - ${doc.timetables.time_infos.getJSONObject(0).time_to}</span> 
182                                            <i class="fal fa-chevron-down fa-lg ml-5"></i> 
183                                        </summary> 
184                                         
185                                        <div class="card-body px-5 lg:px-10"> 
186                                            <ul> 
187                                                <#list doc.timetables.time_infos.iterator() as datetime> 
188                                                    <li class="text-dark mb-1"> 
189                                                        ${d40.getLabel("dal")} ${datetime.date_from} 
190                                                        ${d40.getLabel("al")} ${datetime.date_to} 
191                                                        ${d40.getLabel("dalle")} ${datetime.time_from} 
192                                                        ${d40.getLabel("alle")} ${datetime.time_to} 
193                                                    </li> 
194                                                </#list> 
195                                            </ul> 
196                                        </div> 
197                                    </details> 
198                                </div> 
199                            </#if> 
200                            <div class="card-body px-5 lg:px-10"> 
201                                <#if doc.contacts.getJSONObject(0).telephone?? && doc.contacts.getJSONObject(0).telephone?has_content> 
202                                    <#attempt> 
203                                        <#list doc.contacts.getJSONObject(0).telephone.iterator() as phone> 
204                                            <p class="text-dark text-lg mb-0"> 
205                                                Tel: ${phone} 
206                                            </p> 
207                                        </#list> 
208                                    <#recover> 
209                                        <p class="text-dark text-lg mb-0"> 
210                                            Tel: ${doc.contacts.getJSONObject(0).telephone} 
211                                        </p> 
212                                    </#attempt> 
213                                     
214                                </#if> 
215                                <#if doc.contacts.getJSONObject(0).mail?? && doc.contacts.getJSONObject(0).mail?has_content> 
216                                    <a href="mailto:${doc.contacts.getJSONObject(0).mail}" class="block no-underline text-dark text-lg space-x-2 mb-0"> 
217                                        <i class="far fa-envelope text-dark"></i> 
218                                        <u>${doc.contacts.getJSONObject(0).mail}</u> 
219                                    </a> 
220                                </#if> 
221                                <#if doc.contacts.getJSONObject(0).websiteUrl[langId]?? && doc.contacts.getJSONObject(0).websiteUrl[langId]?has_content> 
222                                    <a href="${doc.contacts.getJSONObject(0).websiteUrl[langId]}" class="block no-underline text-dark text-lg space-x-2 mb-0" target="_blank"> 
223                                        <i class="far fa-external-link text-dark"></i> 
224                                        <u>${d40.getLabel("sito_web")}</u> 
225                                    </a> 
226                                </#if> 
227                                 
228                                <#if langId == 'en'> 
229                                    <#assign ri_url = "/contact-tourist-office-trento" /> 
230                                <#elseif langId == 'de'> 
231                                    <#assign ri_url = "/kontakt-info-anfrage-trento" /> 
232                                <#else> 
233                                    <#assign ri_url = "/richiesta-informazioni" /> 
234                                </#if> 
235                                 
236                                <a href="${ri_url}" class="btn bg-green text-white font-bold uppercase px-4 py-2 rounded-0 mt-10"> 
237                                    ${d40.getLabel("richiedi_info")} 
238                                </a> 
239                            </div> 
240                             
241                            <#if hasCoords> 
242                                <div class="relative flex h-70"> 
243                                    <div class="absolute w-full lg:w-105% h-full right-0"> 
244                                        <div id="suggesto-map" class="monochrome-map size-full border-0"></div> 
245                                    </div> 
246                                </div> 
247                                <div class="card-body p-5 lg:px-10"> 
248                                    <!-- https://www.google.com/maps/dir/?api=1&travelmode=driving&destination=lat,lon  
249                                    https://www.google.com/maps/@${lat},${lng} 
250                                    --> 
251                                    <a href="https://www.google.com/maps/dir/?api=1&travelmode=driving&destination=${lat},${lng}" class="d-block no-underline space-x-5" target="_blank"> 
252                                        <span class="font-bold text-dark uppercase"> 
253                                            ${d40.getLabel("indicazioni_stradali")} 
254                                        </span> 
255                                        <img src="${d40.icons_folder}/arrow_circle-dark.svg" class="w-20" /> 
256                                    </a> 
257                                </div> 
258                            </#if> 
259                        </div> 
260                    </div> 
261                </div> 
262            </div> 
263        </section> 
264         
265        <#if doc.details.images?has_content> 
266            <#assign usePreview = false> 
267             
268            <section id="gallery" class="relative overflow-x-hidden mt-20 lg:mt-40"> 
269                <div class="container"> 
270                    <p class="text-dark uppercase text-lg lg:text-3xl mb-7"> 
271                        ${d40.getLabel("galleria_immagini")} 
272                    </p> 
273                     
274                    <div class="swiper-container"> 
275                        <div class="swiper-wrapper"> 
276                            <#if doc.details.cover != "[]"> 
277                                <#assign usePreview = true> 
278                                 
279                                <#list doc.details.cover.iterator() as pic> 
280                                    <div class="swiper-slide"> 
281                                        <a href="javascript:void(0);" class="card shadow-none border-0 bg-transparent no-underline" data-toggle="modal" data-target="#lightbox-modal" data-slider="${pic?index}" data-senna-off="true"> 
282                                            <div class="relative"> 
283                                                <img data-src="${d40.getKitPrefix(pic[langId], 'n-preview_h')}" loading="lazy" class="lazyload rounded-custom size-full fit-cover" alt="" /> 
284                                            </div> 
285                                        </a> 
286                                    </div> 
287                                     
288                                    <#--assign z=request.setAttribute("ogImage","${pic[langId]}")--> 
289                                  <#assign z=request.setAttribute("ogImage","${d40.getKitPrefix(pic[langId], 'n-preview_h')}")>                                                                         
290                                    <#break> 
291                                </#list> 
292                            </#if> 
293                             
294                            <#list doc.details.images.iterator() as pic> 
295                                <#if usePreview> 
296                                    <#assign counter = pic?counter> 
297                                <#else> 
298                                    <#assign counter = pic?index> 
299                                </#if> 
300                                 
301                                <div class="swiper-slide"> 
302                                    <a href="javascript:void(0);" class="card shadow-none border-0 bg-transparent no-underline" data-toggle="modal" data-target="#lightbox-modal" data-slider="${counter}" data-senna-off="true"> 
303                                        <div class="relative"> 
304                                            <img data-src="${d40.getKitPrefix(pic[langId], 'n-preview_h')}" loading="lazy" class="lazyload rounded-custom size-full fit-cover" alt="" /> 
305                                        </div> 
306                                    </a> 
307                                </div> 
308                            </#list> 
309                        </div> 
310                    </div> 
311                </div> 
312                <div class="btn-square absolute btn-prev bg-white left-0"> 
313                    <span class="sr-only">${d40.getLabel("precedente")}</span> 
314                    <i class="fas fa-chevron-left text-dark w-6 h-6"></i> 
315                </div> 
316                <div class="btn-square absolute btn-next bg-white right-0"> 
317                    <span class="sr-only">${d40.getLabel("successivo")}</span> 
318                    <i class="fas fa-chevron-right text-dark w-6 h-6"></i> 
319                </div> 
320            </section> 
321             
322            <div id="lightbox-modal" tabindex="-1" role="dialog" class="modal fade"> 
323                <div class="modal-dialog modal-full-screen inset-0 border-0 shadow-none"> 
324                    <div class="modal-content bg-transparent"> 
325                        <div class="modal-body overflow-hidden"> 
326                            <div class="absolute top-0 right-0 z-5"> 
327                                <button type="button" data-dismiss="modal" class="btn btn-monospaced btn-secondary m-3"> 
328                                    <span class="sr-only">${d40.getLabel("chiudi")}</span> 
329                                    <i class="fal fa-times fa-lg"></i> 
330                                </button> 
331                            </div> 
332                             
333                            <#-- lightbox --> 
334            				<div id="lightbox-swiper" class="swiper-container h-75 my-auto"> 
335            				    <div class="swiper-button-prev w-12 h-12"> 
336                                    <span class="sticker sticker-circle bg-green size-full"> 
337                                        <span class="sticker-overlay"> 
338                                            <i class="fas fa-chevron-left fa-2x text-white"></i> 
339                                        </span> 
340                                    </span> 
341                                </div> 
342                                 
343                                <div class="swiper-button-next w-12 h-12"> 
344                                    <span class="sticker sticker-circle bg-green size-full"> 
345                                        <span class="sticker-overlay"> 
346                                            <i class="fas fa-chevron-right fa-2x text-white"></i> 
347                                        </span> 
348                                    </span> 
349                                </div> 
350                                 
351                                <div class="swiper-wrapper h-full"> 
352                                    <#if doc.details.cover != "[]"> 
353                                        <#list doc.details.cover.iterator() as pic> 
354                                            <div class="swiper-slide h-full"> 
355                                                <img data-src="${d40.getKitPrefix(pic[langId], 'n-full_hd')}" loading="lazy" class="lazyload flex h-full object-contain mx-auto" alt=""> 
356                                            </div> 
357                                            <#break> 
358                                        </#list> 
359                                    </#if> 
360                                     
361                                    <#list doc.details.images.iterator() as pic> 
362                                        <div class="swiper-slide h-full"> 
363                                            <img data-src="${d40.getKitPrefix(pic[langId], 'n-full_hd')}" loading="lazy" class="lazyload flex h-full object-contain mx-auto" alt=""> 
364                                        </div> 
365                                    </#list> 
366                                </div> 
367                            </div> 
368                             
369                            <#-- thumbnails --> 
370            				<div id="thumbnail-swiper" class="swiper-container" thumbsSlider=""> 
371                                <div class="swiper-wrapper"> 
372                                    <#if doc.details.cover != "[]"> 
373                                        <#list doc.details.cover.iterator() as pic> 
374                                            <div class="swiper-slide"> 
375                                                <img data-src="${d40.getKitPrefix(pic[langId], 'n-preview_h')}" loading="lazy" class="lazyload object-cover cursor-pointer size-full" alt=""> 
376                                            </div> 
377                                            <#break> 
378                                        </#list> 
379                                    </#if> 
380                                     
381                                    <#list doc.details.images.iterator() as pic> 
382                                        <div class="swiper-slide"> 
383                                            <img data-src="${d40.getKitPrefix(pic[langId], 'n-preview_h')}" loading="lazy" class="lazyload object-cover cursor-pointer size-full" alt=""> 
384                                        </div> 
385                                    </#list> 
386                                </div> 
387                            </div> 
388                        </div> 
389                    </div> 
390                </div> 
391            </div> 
392        </#if> 
393         
394        <#-- SEZIONE NON USATA 
395        <section class="mt-20"> 
396            <div class="container"> 
397                <div class="bg-light max-w-xl p-5 lg:p-10"> 
398                    <div class="card-row space-x-5"> 
399                        <div class="autofit-col"> 
400                            <div class="autofit-section"> 
401                                <i class="fas fa-download text-dark w-7 h-7"></i> 
402                            </div> 
403                        </div> 
404                        <div class="autofit-col autofit-col-expand"> 
405                            <div class="autofit-section"> 
406                                <p class="text-dark font-bold text-lg lg:text-xl uppercase mb-0"> Programma completo </p> 
407                            </div> 
408                        </div> 
409                    </div> 
410                </div> 
411                 
412                <div class="row mt-10 lg:mt-20"> 
413                    <div class="col-12 col-lg-8"> 
414                        <div class="space-y-10"> 
415                            <p class="text-dark uppercase text-lg lg:text-3xl"> 
416                                ${d40.getLabel("dettagli")} 
417                            </p> 
418                            <div class="space-y-5"> 
419                                <div class="row"> 
420                                    <div class="col-12 col-md-3 col-lg-2"> 
421                                        <p class="text-dark font-bold uppercase">Data</p> 
422                                    </div> 
423                                    <div class="col-12 col-md-9 col-lg-10"> 
424                                        <div class="text-dark font-light text-lg"> 
425                                            Dettagli 
426                                        </div> 
427                                    </div> 
428                                </div> 
429                            </div> 
430                        </div> 
431                    </div> 
432                </div> 
433            </div> 
434        </section> 
435        --> 
436         
437        <section class="mt-20"> 
438            <div class="container"> 
439                <div class="bg-light"> 
440                    <div class="space-y-10 p-5 lg:p-10"> 
441                        <p class="text-dark uppercase text-lg lg:text-3xl mb-0"> 
442                            ${d40.getLabel("organizzazione")} 
443                        </p> 
444                        <div class="space-y-2"> 
445                            <#if doc.contacts.getJSONObject(0).address.fulltext?? && doc.contacts.getJSONObject(0).address.fulltext?has_content> 
446                                <p class="text-dark mb-0"> 
447                                    ${doc.contacts.getJSONObject(0).address.fulltext} 
448                                </p> 
449                            </#if> 
450                             
451                            <#if doc.contacts.getJSONObject(0).mail?? && doc.contacts.getJSONObject(0).mail?has_content> 
452                                <a href="mailto:${doc.contacts.getJSONObject(0).mail}" class="d-block text-dark underline"> 
453                                    ${doc.contacts.getJSONObject(0).mail} 
454                                </a> 
455                            </#if> 
456                             
457                            <#if doc.contacts.getJSONObject(0).telephone?? && doc.contacts.getJSONObject(0).telephone?has_content> 
458                                <#attempt> 
459                                    <#list doc.contacts.getJSONObject(0).telephone.iterator() as phone> 
460                                        <p class="text-dark mb-0"> 
461                                            <span class="font-bold">${d40.getLabel("telefono")}:</span> 
462                                            ${phone} 
463                                        </p> 
464                                    </#list> 
465                                <#recover> 
466                                    <p class="text-dark mb-0"> 
467                                        <span class="font-bold">${d40.getLabel("telefono")}:</span> 
468                                        ${doc.contacts.getJSONObject(0).telephone} 
469                                    </p> 
470                                </#attempt> 
471                            </#if> 
472                        </div> 
473                    </div> 
474                </div> 
475            </div> 
476        </section> 
477         
478        <#-- 
479        <section class="mt-10"> 
480            <div class="container"> 
481                <p class="text-dark uppercase text-lg lg:text-3xl mb-7"> Info sezione </p> 
482                <p class="text-dark text-lg font-light mb-0"> Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. </p> 
483            </div> 
484        </section> 
485        --> 
486    <#else> 
487        <div class="text-center mt-35"> 
488            <p class="text-dark"> 
489                ${d40.getLabel("errore_caricamento_contenuto")} 
490            </p> 
491        </div> 
492    </#if> 
493</div> 
494 
495<script type="module"> 
496    import { createApp } from "https://cdnjs.cloudflare.com/ajax/libs/petite-vue/0.4.1/petite-vue.es.min.js"; 
497 
498    createApp({ 
499        isMobile: window.innerWidth < 768, 
500        favorites: [], 
501        getFavorites() { 
502            if(localStorage.getItem("favorites") !== null) { 
503    			this.favorites = JSON.parse(localStorage.getItem("favorites")); 
504
505        }, 
506        setFavorite(e, item) { 
507            e.preventDefault(); 
508    		this.getFavorites(); 
509     
510    		var newFavorite = { 
511    			id: item.id, 
512        			contentJSON: { 
513    				title: item.contentJSON.title, 
514    				previewDescription: item.contentJSON.previewDescription, 
515    				description: item.contentJSON.description, 
516    				geoRef: item.contentJSON.geoRef, 
517    				previewPicture: item.contentJSON.previewPicture, 
518    				viewUrl: item.contentJSON.viewUrl, 
519    				type: "lfr", 
520
521    		}; 
522     
523    		this.favorites.push(newFavorite); 
524    		this.saveFavorites(); 
525    	}, 
526    	removeFavorite(e, itemId) { 
527    	    e.preventDefault(); 
528    		this.favorites = this.favorites.filter((obj) => obj.id !== itemId); 
529    		this.saveFavorites(); 
530    	}, 
531    	saveFavorites() { 
532    		localStorage.setItem("favorites", JSON.stringify(this.favorites)); 
533    	}, 
534    	isFavorite(itemId) { 
535    		if (this.favorites.some((e) => e.id == itemId)) { 
536    			return true; 
537
538     
539    		return false; 
540    	}, 
541    	buildMap(lat, lng) { 
542            var map = new SuggestoMap("suggesto-map"), 
543                location = [parseFloat(lat), parseFloat(lng)]; 
544             
545            var svgIcon = L.divIcon({ 
546                html: ` 
547                    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 44.537 64.343"> 
548                        <path d="M32.952,68c-4.491-5.935-9.221-11.692-12.837-18.251-3.4-6.175-5.892-12.453-4.094-19.725,2.422-9.787,12.253-17.363,22.112-16.878,11.322.558,20.189,8.638,21.649,19.385.8,5.867-1.25,10.892-3.84,15.837A105.38,105.38,0,0,1,43.958,65.889c-.687.844-1.309,1.739-1.96,2.611-.953,1.06-1.971,2.068-2.841,3.191-.965,1.245-1.729,1.629-2.844.1A50.506,50.506,0,0,0,32.952,68m4.722-46.328A14.156,14.156,0,0,0,23.76,35.59c-.168,7.053,6.542,13.748,13.813,13.783A14.234,14.234,0,0,0,51.46,35.693,14.138,14.138,0,0,0,37.674,21.676" transform="translate(-15.419 -13.129)" fill="#5098c6"/> 
549                        <path d="M31.941,63.206A50.288,50.288,0,0,1,35.3,67c1.116,1.526,1.878,1.142,2.844-.1.87-1.123,1.889-2.132,2.841-3.191a8.579,8.579,0,0,1,5.414,2.22c1.659,1.642,1.586,3.631-.455,4.627a21.209,21.209,0,0,1-16.871.723c-1.611-.565-3.293-1.51-3.092-3.645.19-2.018,1.855-2.718,3.511-3.342.833-.315,1.791-.363,2.447-1.079" transform="translate(-14.408 -8.331)" fill="#222"/> 
550                        <path d="M36.946,20.929A14.137,14.137,0,0,1,50.732,34.944,14.236,14.236,0,0,1,36.844,48.626c-7.27-.036-13.98-6.732-13.813-13.783A14.157,14.157,0,0,1,36.946,20.929m-.023,5.445a8.4,8.4,0,1,0,8.394,8.22,8.5,8.5,0,0,0-8.394-8.22" transform="translate(-14.69 -12.381)" fill="#fdfcf9"/> 
551                        <path d="M36.45,25.9a8.4,8.4,0,0,1,.077,16.809A8.405,8.405,0,1,1,36.45,25.9" transform="translate(-14.218 -11.905)" fill="#222"/> 
552                    </svg>`, 
553                className: "", 
554                iconSize: [44.537, 64.343], 
555                iconAnchor: [22.287, 64.343], 
556            }); 
557                 
558            var mapData = { 
559                tilelayer: "osm", 
560                gestureHandling: true, 
561                fitBounds: false, 
562                mapcenter: location, 
563                zoom: 15, 
564                markersFilter: "*", 
565                markers: [], 
566                layers: [] 
567            }; 
568                 
569            map.sm.createMap(mapData); 
570             
571            L.circleMarker(location, { 
572                radius: 0, 
573                color: "#000", 
574                fillOpacity: 0, 
575                weight: 0 
576            }).addTo(map.sm.lmap); 
577             
578            L.marker(location, { 
579                icon: svgIcon 
580            }).addTo(map.sm.lmap); 
581        }, 
582        share(title, desc, mode = "legacy") { 
583            if (this.isMobile) { 
584                var shareData = { 
585                    title: title, 
586                    text: desc, 
587                    url: window.location.href.replaceAll("{", "%7B").replaceAll("}", "%7D") 
588                }; 
589 
590                try { 
591                    navigator.share(shareData); 
592                } catch (err) { 
593                    console.error("Error sharing: " + err); 
594 
595                    if (mode == "legacy") { 
596                        this.legacyShare(); 
597                    } else if (mode == "social") { 
598                        this.socialShare(title, desc); 
599
600
601            } else { 
602                if (mode == "legacy") { 
603                    this.legacyShare(); 
604                } else if (mode == "social") { 
605                    this.socialShare(title, desc); 
606
607
608        }, 
609        legacyShare() { 
610            var clip = document.createElement("input"), 
611                toCopy = window.location.href.replaceAll("{", "%7B").replaceAll("}", "%7D"); 
612 
613            document.body.appendChild(clip); 
614            clip.value = toCopy; 
615            clip.select(); 
616            clip.setSelectionRange(0, 999999); 
617 
618            navigator.clipboard.writeText(clip.value); 
619            document.body.removeChild(clip); 
620 
621            alert("Link copiato"); 
622        }, 
623        socialShare(title, desc, image = "") { 
624            var link = "#", 
625                winHeight = 450, 
626                winWidth = 600, 
627                winTop = window.screen.height / 2 - winHeight / 2, 
628                winLeft = window.screen.width / 2 - winWidth / 2, 
629                params = "scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no,width=" + winWidth + ",height=" + winHeight + ",left=" + winLeft + ",top=" + winTop; 
630 
631            link = "http://www.facebook.com/sharer.php?s=100&p[title]=" + encodeURIComponent(title) + "&p[summary]=" + encodeURIComponent(desc) + "&p[url]=" + window.location.href + "&p[images][0]=" + image; 
632 
633            window.open(link, "Facebook", params); 
634
635    }).mount("#${d40.portletNamespace}"); 
636</script> 
637 
638<#if doc?has_content> 
639    <script> 
640        document.addEventListener("DOMContentLoaded", function(){ 
641            if(${(doc.details.images?has_content)?c}){ 
642                new Swiper("#gallery .swiper-container", { 
643                    slidesPerView: 1, 
644                    spaceBetween: 50, 
645                    centerSlides: true, 
646                    centerInsufficientSlides: true, 
647                    breakpoints: { 
648                        768: { 
649                            slidesPerView: 2, 
650                            spaceBetween: 25 
651                        }, 
652                        992: { 
653                            slidesPerView: 3, 
654                            spaceBetween: 25 
655
656                    }, 
657                    navigation: { 
658                        prevEl: "#gallery .btn-prev", 
659                        nextEl: "#gallery .btn-next" 
660
661                }); 
662                 
663                var thumbnails = new Swiper("#thumbnail-swiper", { 
664                    spaceBetween: 10, 
665                    slidesPerView: 2, 
666                    centerInsufficientSlides: true, 
667                    freeMode: true, 
668                    watchSlidesVisibility: true, 
669                    watchSlidesProgress: true, 
670        			breakpoints: { 
671        				768: { 
672        					slidesPerView: 3 
673        				}, 
674        				992: { 
675        					slidesPerView: 4 
676        				}, 
677        				1200: { 
678        					slidesPerView: 5 
679
680        			}, 
681                }); 
682                 
683                var lightbox = new Swiper("#lightbox-swiper", { 
684        		    spaceBetween: 10, 
685                    autoHeight: true, 
686                    observer: true, 
687                    observeSlideChildren: true, 
688                    keyboard: { 
689                        enabled: true 
690                    }, 
691                    navigation: { 
692                        nextEl: ".swiper-button-next", 
693                        prevEl: ".swiper-button-prev" 
694                    }, 
695                    thumbs: { 
696                        swiper: thumbnails 
697
698                }); 
699                 
700                $("#lightbox-modal").on("shown.bs.modal", function(e){ 
701                    lightbox.update(); 
702                    thumbnails.update(); 
703                    lightbox.slideTo($(e.relatedTarget).data("slider")); 
704                    lightbox.update(); 
705                }); 
706                 
707                $("#lightbox-modal .swiper-wrapper").on("click", function(e){ 
708                    if($(e.target).attr("class").includes("swiper-slide")){ 
709                        $("#lightbox-modal").modal("hide"); 
710
711                }); 
712                 
713                if ($(window).width() > 991) { 
714                    var left_col_h = $(".relative.mt-20 > .container > .row > .col-lg-7").outerHeight(); 
715                    var right_col_h = $(".relative.mt-20 > .container > .row > .col-lg-5").outerHeight(); 
716                    var marg_h = right_col_h - left_col_h + 40; 
717                     
718                    if(right_col_h > left_col_h) 
719
720                        $('#gallery').removeClass('lg:mt-40 mt-20'); 
721                        $('#gallery').css({'margin-top':marg_h+'px'});  
722
723
724
725        }); 
726    </script> 
727</#if>