Publicador de Conteúdos e Mídias

Um erro ocorreu enquanto processava o modelo.
The following has evaluated to null or missing:
==> themeDisplay.getURLCurrent()?split("/")[2]  [in template "20102#20129#34563606" at line 344, column 41]

----
Tip: It's the final [] step that caused this error, not those before it.
----
Tip: If the failing expression is known to 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 friendlyURLTipoCurso = themeD...  [in template "20102#20129#34563606" in function "getTipoCursoFirendlyUrl" at line 344, column 9]
----
1<#-- 
2Name: Unidade Página Modalidades 
3Type: Asset Publisher Widget Template 
4Path: ROOT/assets/unidades-tipos-de-curso/widget-templates/unidades_pagina_modalidades.html 
5--> 
6<#assign prefix = "ssp" /> 
7<#assign companyId = themeDisplay.getCompanyId() /> 
8<#assign siteGroupId = themeDisplay.getSiteGroupId() /> 
9<#assign friendlyUrlTipoCurso = getTipoCursoFirendlyUrl() /> 
10<#assign friendlyUrlUnidade = getUnidadeFirendlyUrl() /> 
11 
12<#assign categoryId = 0 /> 
13 
14<#if friendlyUrlTipoCurso?contains("livre")> 
15   	<#assign tipoCurso = "Livre" /> 
16	<#assign friendlyUrlTemaFirst = getTemaFirstLevelFriendly() /> 
17	<#assign friendlyUrlTemaSecond = getTemaSecondLevelFriendly() /> 
18	<#assign friendlyUrlTemaThird = getTemaThirdLevelFriendly() /> 
19 
20<#-- cursos tecnicos nao tem 2o e 3o nivel de temas conforme prototipo GCR --> 
21<#else> 
22    <#assign tipoCurso = "Técnico" /> 
23    <#assign friendlyUrlTemaFirst = getTemaFirstLevelFriendly() /> 
24	<#assign friendlyUrlTemaSecond = "#erro#" /> 
25	<#assign friendlyUrlTemaThird = "#erro#" /> 
26</#if> 
27 
28<#assign groupService = serviceLocator.findService("com.liferay.portal.kernel.service.GroupLocalService") /> 
29<#assign groupObj = groupService.fetchFriendlyURLGroup(companyId, "/"+friendlyUrlUnidade) /> 
30<#assign groupIdUnidade = groupObj.getGroupId() /> 
31 
32		<#assign journal = getJournalArticle(groupIdUnidade) > 
33		<#if !journal?contains("#erro#")> 
34			 <#assign groupIdUnidade = groupId /> 
35			 <#assign journalArticleUnidade = journal> 
36			<#assign document = saxReaderUtil.read(journalArticleUnidade.getContent()) /> 
37			<#assign rootElement = document.getRootElement() /> 
38			 
39			    <#-- Get fields --> 
40 
41					 <#--  Nome da unidade  --> 
42                    <#assign xPathSelector_nomeUnidadeParaBreadCrumb = saxReaderUtil.createXPath("dynamic-element[@field-reference='nomeUnidade']")> 
43                    <#assign nomeUnidadeParaBreadCrumb = xPathSelector_nomeUnidadeParaBreadCrumb.selectSingleNode(rootElement).getStringValue()> 
44 
45                    <#--  Nome da unidade  --> 
46                    <#assign xPathSelector_nome = saxReaderUtil.createXPath("dynamic-element[@field-reference='nomeUsualUnidade']")> 
47                    <#assign nomeUnidade = xPathSelector_nome.selectSingleNode(rootElement).getStringValue()> 
48 
49                    <#assign xPathSelector_codigoUnidade = saxReaderUtil.createXPath("dynamic-element[@field-reference='codigoUnidade']")> 
50                    <#assign codigoUnidade = xPathSelector_codigoUnidade.selectSingleNode(rootElement).getStringValue()?trim> 
51                     
52                        <#if nomeUnidade?? > 
53                            <#assign nome = nomeUnidade > 
54                            <#else> 
55                            <#assign nome = "" > 
56                        </#if> 
57 
58                <#--  Endereço 1  --> 
59 
60                        <#--  Rua  --> 
61                        <#assign xPathSelector_enderecoUnidade = saxReaderUtil.createXPath("dynamic-element[@field-reference='enderecoUnidade']")> 
62                        <#assign enderecoUnidade = xPathSelector_enderecoUnidade.selectSingleNode(rootElement).getStringValue()?trim> 
63 
64                            <#if enderecoUnidade?? > 
65                                <#assign endereco = enderecoUnidade > 
66                                <#else> 
67                                <#assign endereco = "" > 
68                            </#if> 
69 
70                        <#--  número  --> 
71                        <#assign xPathSelector_numEnderecoUnidade = saxReaderUtil.createXPath("dynamic-element[@field-reference='numEnderecoUnidade']")> 
72                        <#assign numeroUnidade = xPathSelector_numEnderecoUnidade.selectSingleNode(rootElement).getStringValue()?trim> 
73 
74                            <#if numeroUnidade?? > 
75                                <#assign numero = numeroUnidade > 
76                                <#else> 
77                                <#assign numero = "" > 
78                            </#if> 
79 
80                        <#--  Bairro  --> 
81                        <#assign xPathSelector_bairroUnidade = saxReaderUtil.createXPath("dynamic-element[@field-reference='bairroUnidade']")> 
82                        <#assign bairroUnidade = xPathSelector_bairroUnidade.selectSingleNode(rootElement).getStringValue()?trim> 
83 
84                            <#if bairroUnidade?? > 
85                                <#assign bairro = bairroUnidade > 
86                                <#else> 
87                                <#assign bairro = "" > 
88                            </#if> 
89                         
90                        <#--  Cidade  --> 
91                        <#assign xPathSelector_cidadeUnidade = saxReaderUtil.createXPath("dynamic-element[@field-reference='cidadeUnidade']")> 
92                        <#assign cidadeUnidade = xPathSelector_cidadeUnidade.selectSingleNode(rootElement).getStringValue()?trim> 
93 
94                            <#if cidadeUnidade?? > 
95                                <#assign cidade = cidadeUnidade > 
96                                <#else> 
97                                <#assign cidade = "" > 
98                            </#if> 
99 
100                        <#--  Cep  --> 
101                        <#assign xPathSelector_cepUnidade = saxReaderUtil.createXPath("dynamic-element[@field-reference='cepUnidade']")> 
102                        <#assign cepUnidade = xPathSelector_cepUnidade.selectSingleNode(rootElement).getStringValue()?trim> 
103 
104                            <#if cepUnidade?? > 
105                                <#assign cep = cepUnidade > 
106                                <#else> 
107                                <#assign cep = "" > 
108                            </#if>  
109 
110            <#-- Fim endereço 1 -->   
111 
112            <#--  Endereço 2  --> 
113 
114                        <#--  Rua  --> 
115                        <#assign xPathSelector_enderecoUnidade2 = saxReaderUtil.createXPath("dynamic-element[@field-reference='enderecoUnidade2']")> 
116                        <#assign enderecoUnidade2 = xPathSelector_enderecoUnidade2.selectSingleNode(rootElement).getStringValue()?trim> 
117 
118                            <#if enderecoUnidade2?? > 
119                                <#assign endereco2 = enderecoUnidade2 > 
120                                <#else> 
121                                <#assign endereco2 = "" > 
122                            </#if> 
123 
124                        <#--  número  --> 
125                        <#assign xPathSelector_numeroUnidade2 = saxReaderUtil.createXPath("dynamic-element[@field-reference='numeroUnidade2']")> 
126                        <#assign numeroUnidade2 = xPathSelector_numeroUnidade2.selectSingleNode(rootElement).getStringValue()?trim> 
127 
128                            <#if numeroUnidade2?? > 
129                                <#assign numero2 = numeroUnidade2 > 
130                                <#else> 
131                                <#assign numero2 = "" > 
132                            </#if> 
133 
134                        <#--  Bairro  --> 
135                        <#assign xPathSelector_bairroUnidade2 = saxReaderUtil.createXPath("dynamic-element[@field-reference='bairroUnidade2']")> 
136                        <#assign bairroUnidade2 = xPathSelector_bairroUnidade2.selectSingleNode(rootElement).getStringValue()?trim> 
137 
138                            <#if bairroUnidade2?? > 
139                                <#assign bairro2 = bairroUnidade2 > 
140                                <#else> 
141                                <#assign bairro2 = "" > 
142                            </#if> 
143                         
144                        <#--  Cidade  --> 
145                        <#assign xPathSelector_cidadeUnidade2 = saxReaderUtil.createXPath("dynamic-element[@field-reference='cidadeUnidade2']")> 
146                        <#assign cidadeUnidade2 = xPathSelector_cidadeUnidade2.selectSingleNode(rootElement).getStringValue()?trim> 
147 
148                            <#if cidadeUnidade2?? > 
149                                <#assign cidade2 = cidadeUnidade2 > 
150                                <#else> 
151                                <#assign cidade2 = "" > 
152                            </#if> 
153 
154                        <#--  Cep  --> 
155                        <#assign xPathSelector_cepUnidade2 = saxReaderUtil.createXPath("dynamic-element[@field-reference='cepUnidade2']")> 
156                        <#assign cepUnidade2 = xPathSelector_cepUnidade2.selectSingleNode(rootElement).getStringValue()?trim> 
157 
158                            <#if cepUnidade2?? > 
159                                <#assign cep2 = cepUnidade2 > 
160                                <#else> 
161                                <#assign cep2 = "" > 
162                            </#if>  
163 
164            <#-- Fim endereço 2 --> 
165 
166 
167 
168                        <#--  Horário  --> 
169                        <#assign xPathSelector_horarioUnidade = saxReaderUtil.createXPath("dynamic-element[@field-reference='horarioUnidade']")> 
170                        <#assign horarioUnidade = xPathSelector_horarioUnidade.selectSingleNode(rootElement).getStringValue()?trim> 
171 
172                            <#if horarioUnidade?? > 
173                                <#assign horario = horarioUnidade > 
174                                <#else> 
175                                <#assign horario = "" > 
176                            </#if> 
177 
178                        <#--  DDD  --> 
179                        <#assign xPathSelector_dddUnidade = saxReaderUtil.createXPath("dynamic-element[@field-reference='dddTelefoneUnidade']")> 
180                        <#assign dddUnidade = xPathSelector_dddUnidade.selectSingleNode(rootElement).getStringValue()?trim> 
181 
182                            <#if dddUnidade?? > 
183                                <#assign ddd = dddUnidade > 
184                                <#else> 
185                                <#assign ddd = "" > 
186                            </#if> 
187 
188                        <#--  telefone  --> 
189                        <#assign xPathSelector_telefoneUnidade = saxReaderUtil.createXPath("dynamic-element[@field-reference='telefoneUnidade']")> 
190                        <#assign telefoneUnidade = xPathSelector_telefoneUnidade.selectSingleNode(rootElement).getStringValue()?trim> 
191 
192                            <#if telefoneUnidade?? > 
193                                <#assign telefone = telefoneUnidade > 
194                                <#else> 
195                                <#assign telefone = "" > 
196                            </#if>                         
197 
198                        <#--  UF  --> 
199                        <#assign xPathSelector_ufUnidade = saxReaderUtil.createXPath("dynamic-element[@field-reference='ufUnidade']")> 
200                        <#assign ufUnidade = xPathSelector_ufUnidade.selectSingleNode(rootElement).getStringValue()?trim> 
201 
202                            <#if ufUnidade?? > 
203                                <#assign UF = ufUnidade > 
204                                <#else> 
205                                <#assign UF = "" > 
206                            </#if> 
207 
208                        <#-- Estacionamento --> 
209                        <#assign xPathSelector_estacionamento = saxReaderUtil.createXPath("dynamic-element[@field-reference='estacionamentoUnidade']")> 
210                        <#assign estacionamentoUnidade = xPathSelector_estacionamento.selectSingleNode(rootElement).getStringValue()>  
211 
212                            <#if estacionamentoUnidade?? > 
213                                <#assign estacionamento = estacionamentoUnidade > 
214                                <#else> 
215                                <#assign estacionamento = "" > 
216                            </#if> 
217 
218                         <#-- Estacionamento Unidade 2 --> 
219                        <#assign xPathSelector_estacionamento2 = saxReaderUtil.createXPath("dynamic-element[@field-reference='estacionamentoUnidade2']")> 
220                        <#assign estacionamentoUnidade2 = xPathSelector_estacionamento2.selectSingleNode(rootElement).getStringValue()>  
221 
222                            <#if estacionamentoUnidade2?? > 
223                                <#assign estacionamento2 = estacionamentoUnidade2 > 
224                                <#else> 
225                                <#assign estacionamento2 = "" > 
226                            </#if>          
227 
228                        <#--  Facebook  --> 
229                        <#assign xPathSelector_facebookUnidade = saxReaderUtil.createXPath("dynamic-element[@field-reference='facebookUnidade']")> 
230                        <#assign facebookUnidade = xPathSelector_facebookUnidade.selectSingleNode(rootElement).getStringValue()> 
231 
232                            <#if facebookUnidade?? > 
233                                <#assign facebook = facebookUnidade > 
234                                <#else> 
235                                <#assign facebook = "" > 
236                            </#if> 
237 
238                        <#--  Instagram  --> 
239                        <#assign xPathSelector_instagramUnidade = saxReaderUtil.createXPath("dynamic-element[@field-reference='instagramUnidade']")> 
240                        <#assign instagramUnidade = xPathSelector_instagramUnidade.selectSingleNode(rootElement).getStringValue()> 
241 
242                            <#if instagramUnidade?? > 
243                                <#assign instagram = instagramUnidade > 
244                                <#else> 
245                                <#assign instagram = "" > 
246                            </#if> 
247 
248                        <#--  Maps  --> 
249                        <#assign xPathSelector_googlemapsUnidade = saxReaderUtil.createXPath("dynamic-element[@field-reference='googlemapsUnidade']")> 
250                        <#assign googlemapsUnidade = xPathSelector_googlemapsUnidade.selectSingleNode(rootElement).getStringValue()?trim> 
251 
252                            <#if googlemapsUnidade?? > 
253                                <#assign googlemaps = googlemapsUnidade > 
254                                <#else> 
255                                <#assign googlemaps = "" > 
256                            </#if> 
257 
258                        <#assign  hasMaps = (googlemaps?trim?length > 0) > 
259 
260                         
261 
262                        <#--  Waze  --> 
263                        <#assign xPathSelector_wazeUnidade = saxReaderUtil.createXPath("dynamic-element[@field-reference='wazeUnidade']")> 
264                        <#assign wazeUnidade = xPathSelector_wazeUnidade.selectSingleNode(rootElement).getStringValue()> 
265 
266                            <#if wazeUnidade?? > 
267                                <#assign waze = wazeUnidade > 
268                                <#else> 
269                                <#assign waze = "" > 
270                            </#if>    
271 
272                                       
273 
274                                 
275                    <#--  Imagem  --> 
276 
277                    <#assign imagem = getImagemURL('imagemUnidade')> 
278                    <#assign imagem2 = getImagemURL('imagemUnidade2')>    
279                     
280                    <#--  Estação próxima  -->                     
281					<#assign xPathSelector_estacaoProxima = saxReaderUtil.createXPath("dynamic-element[@field-reference='estacaoProxima']")> 
282		 
283					<#assign estacaoProxima = xPathSelector_estacaoProxima.selectSingleNode(rootElement).getStringValue()> 
284		 
285					<#assign  hasEstacaoProxima = (estacaoProxima?trim?length > 0) > 
286		 	</#if> 
287 
288	<#function getImagemURL fieldName> 
289 
290		<#assign xPathSelector = saxReaderUtil.createXPath("dynamic-element[@field-reference='${fieldName}']")> 
291	 
292		<#assign imagemStr = xPathSelector.selectSingleNode(rootElement).getStringValue()> 
293	 
294		<#if imagemStr?contains("classPK") > 
295			<#assign 
296				imagemJson = jsonFactoryUtil.createJSONObject(imagemStr) 
297				imagemId = getterUtil.getInteger(imagemJson.get('fileEntryId')) 
298				dl = serviceLocator.findService("com.liferay.document.library.kernel.service.DLAppService") 
299				dlURLHelper = serviceLocator.findService("com.liferay.document.library.util.DLURLHelper") 
300				fileEntry = dl.getFileEntry(imagemId) 
301				imagemURL = dlURLHelper.getImagePreviewURL(fileEntry, themeDisplay) 
302				imagem = { 
303					"alt" : imagemJson.get('alt'), 
304					"url" : imagemURL 
305				}  
306			/> 
307			<#return imagem> 
308		</#if> 
309		 
310		<#return {"alt":"", "url":""}> 
311	 
312	</#function> 
313 
314 <#function getJournalArticle groupId> 
315    <#assign journalArticleService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService") /> 
316    <#assign friendlyURL = getUnidadeFirendlyUrl()> 
317    
318    <#attempt> 
319   
320      <#if !friendlyURL?contains("fragment_collections") > 
321         
322        <#return journalArticleService.getArticleByUrlTitle(groupId,friendlyURL)> 
323         
324      </#if> 
325       
326    <#recover> 
327         
328      <#return '#erro#'> 
329    </#attempt> 
330 </#function> 
331 
332 <#function getUnidadeFirendlyUrl > 
333 	 <#assign friendly = themeDisplay.getURLCurrent()?split("/")[1]?split("?")?first /> 
334 	 <#if friendly?contains("web") > 
335    	 <#assign friendly = themeDisplay.getURLCurrent()?split("/")[3]?split("?")?first> 
336    </#if> 
337     
338    <#return friendly /> 
339     
340 </#function> 
341   
342 <#function getTipoCursoFirendlyUrl > 
343 	 
344 	<#assign friendlyURLTipoCurso = themeDisplay.getURLCurrent()?split("/")[2]?split("?")?first /> 
345 	<#if friendlyURLTipoCurso?contains("guest") > 
346   	 	<#assign friendlyURLTipoCurso = themeDisplay.getURLCurrent()?split("/")[4]?split("?")?first> 
347   	</#if> 
348     	 
349    <#return friendlyURLTipoCurso /> 
350     
351 </#function> 
352 
353 <#function getTemaFirstLevelFriendly > 
354 	 <#attempt> 
355	 	<#assign friendly = themeDisplay.getURLCurrent()?split("/")[1]?split("?")?first /> 
356	 	 <#if !friendly?contains("web") > 
357	 	 	 <#if themeDisplay.getURLCurrent()?split("/")?size gt 3 > 
358	 	 		<#assign friendly = themeDisplay.getURLCurrent()?split("/")[3]?split("?")?first /> 
359	 	 	<#else> 
360	 	 		<#assign friendly = "" /> 
361	 	 	</#if>	 
362	 	 		 
363		<#else> 
364			<#if themeDisplay.getURLCurrent()?split("/")?size gt 5 > 
365	    	 	<#assign friendly = themeDisplay.getURLCurrent()?split("/")[5]?split("?")?first> 
366	    	 <#else> 
367	 	 		<#assign friendly = "" /> 
368	 	 	</#if> 
369	     </#if> 
370	      	  
371	    <#return friendly /> 
372    <#recover> 
373     	<#return '#erro#'> 
374    </#attempt> 
375     
376</#function>  
377 
378 <#function getTemaSecondLevelFriendly > 
379 	 <#attempt> 
380	 	 <#assign friendly = themeDisplay.getURLCurrent()?split("/")[1]?split("?")?first /> 
381	 	 
382	 	 <#if !friendly?contains("web") > 
383	 		 <#if themeDisplay.getURLCurrent()?split("/")?size gt 4 > 
384	 		 	<#assign friendly = themeDisplay.getURLCurrent()?split("/")[4]?split("?")?first /> 
385	 		 <#else> 
386	 	 		<#assign friendly = "" /> 
387	 	 	</#if>		 
388		<#else> 
389			 <#if themeDisplay.getURLCurrent()?split("/")?size gt 6 > 
390	    		 <#assign friendly = themeDisplay.getURLCurrent()?split("/")[6]?split("?")?first> 
391    		<#else> 
392	 	 		<#assign friendly = "" /> 
393	 	 	</#if>	  
394	    </#if> 
395	 
396	    <#return friendly /> 
397    <#recover> 
398     	<#return '#erro#'> 
399    </#attempt> 
400     
401</#function>  
402  
403 <#function getTemaThirdLevelFriendly > 
404 	 <#attempt> 
405	 	 <#assign friendly = themeDisplay.getURLCurrent()?split("/")[1]?split("?")?first /> 
406	 	  
407	 	 <#if !friendly?contains("web") > 
408	 	 	<#if themeDisplay.getURLCurrent()?split("/")?size gt 5 > 
409	 	 		<#assign friendly = themeDisplay.getURLCurrent()?split("/")[5]?split("?")?first /> 
410	 	 	<#else> 
411	 	 		<#assign friendly = "" /> 
412	 	 	</#if>	 
413		<#else> 
414			<#if themeDisplay.getURLCurrent()?split("/")?size gt 7 > 
415	    	 	<#assign friendly = themeDisplay.getURLCurrent()?split("/")[7]?split("?")?first> 
416	    	<#else> 
417	 	 		<#assign friendly = "" /> 
418	 	 	</#if> 	 
419	    </#if> 
420		    <#return friendly /> 
421    <#recover> 
422     	<#return '#erro#'> 
423    </#attempt> 
424     
425</#function>  
426 
427<style> 
428 
429/*Header Unidade*/ 
430 
431.ssp-header-unidade__content-info-body{ 
432	padding-top:30px; 
433
434 
435.ssp-header-unidade__atendimento-container > p > a { 
436    color:white!important; 
437
438 
439.ssp-header-unidade__atendimento-container > p > a:hover { 
440    color:white!important; 
441    font-weight: normal!important; 
442
443 
444.creditoFotoMob{ 
445 
446    margin: 0 auto; 
447    background: #FFF7D6; 
448    font-family: 'Montserrat'; 
449    font-size: 14px; 
450    line-height: 1.6em; 
451    border-radius: 3px; 
452    max-width: 240px; 
453    height: auto; 
454    color: #4F596F; 
455    padding: 5px; 
456    position: relative;     
457    float: right;     
458    top: 70%; 
459    max-height: 40px; 
460    font-weight: 500; 
461    right: 15%; 
462    flex-wrap: unset; 
463
464 
465.creditoFotoMob:after{ /*Triangulo*/ 
466    content: ""; 
467    width: 0; 
468    height: 0; 
469    position: absolute; 
470    border-left: 10px solid transparent; 
471    border-right: 10px solid transparent; 
472    /*Faz seta "apontar para baixo. Definir o valor como 'top' fará ela "apontar para cima" */ 
473    /*Aqui entra a cor da "aba" do balão */ 
474    border-bottom: 10px solid #FFF7D6; 
475    top: -9px; /*localização. Experimente alterar para 'bottom'*/ 
476    left: 20%; 
477
478.tooltip-inner { 
479    max-width: 230px; 
480    padding: 0.75rem 0.75rem; 
481    color: #4F596F; 
482    text-align: center; 
483    background-color: #FFF7D6; 
484    border-radius: 0.3125rem; 
485
486.bs-tooltip-top .arrow::before, .bs-tooltip-auto[x-placement^="top"] .arrow::before { 
487    top: 0; 
488    border-width: 0.4rem 0.4rem 0; 
489    border-top-color: #FFF7D6; 
490
491.ssp-header-title-bloco { 
492    font-size: 20px; 
493    font-weight: 600; 
494
495 
496.ssp:not(.liferay-instance) .ssp-header-unidade__imagem-box-imagem{ 
497    height:100%; 
498
499/*#slider { 
500    width: 80%; 
501    max-width: 500px; 
502    height: 25vw; 
503    max-height: 150px; 
504 
505    position: relative; 
506}*/ 
507 
508#slider .ssp-header-unidade__imagem-box-imagem{ 
509    opacity: 0; 
510    position: absolute; 
511    /*width: 100%; 
512    height: 100%;*/ 
513    object-fit: cover; 
514    transition: opacity 2000ms; 
515
516 
517#slider .ssp-header-unidade__imagem-box-imagem.selected {  
518    opacity: 1; 
519
520 
521@media only screen and (max-width: 1024px) { 
522     
523#slider .ssp-header-unidade__imagem-box-imagem{  
524    margin-top: -240px; 
525    height: 248px; 
526 
527
528 .ssp-header-unidade__container-info { 
529    margin-top: 240px!important; 
530
531 
532
533 
534 @media only screen and (max-width: 768px){ 
535 
536  .ssp:not(.liferay-instance) .ssp-header-unidade__imagem-box-imagem{ 
537    height:228px; 
538
539  .ssp-header-title-bloco { 
540    font-size: 14px;     
541}    
542 
543  .creditoFotoMob{ 
544    font-size: 9px!important; 
545    max-width: 161px!important; 
546    max-height: 30px!important; 
547    padding: 8.5px 9.5px!important; 
548    line-height: 0.6em!important; 
549     
550
551}  
552 
553/* Final Header Unidade*/ 
554 
555.btn-nivel-livre-ead{ 
556        background-color: #ff9057; 
557        border-color: #ff9057; 
558        box-shadow: none; 
559
560 
561    .icon-ao-vivo{ 
562    font-size:12px; 
563    margin:0 3px; 
564
565 
566 
567.subtema-ativo{ 
568 
569    color:#fcc080!important; 
570
571 
572.separador-subtemas{ 
573	width:100% !important; 
574	margin-top: -1em !important; 
575    margin-bottom: 2.25rem!important; 
576
577 
578</style> 
579 
580<#if tipoCurso == "Livre"> 
581 
582	<style> 
583	.ssp:not(.liferay-instance) .ativo{ 
584	  background-color: #FF9057!important; 
585	  color:white!important; 
586	  font-weight: 600!important; 
587
588	 
589	.tema-ativo{ 
590	  background-color: #FF9057!important; 
591	  color:white!important; 
592	  font-weight: 600!important; 
593
594	</style> 
595 
596<#else> 
597 
598	<style> 
599	   
600	.ssp:not(.liferay-instance) .ativo{ 
601	  background-color: #F7BD23!important; 
602			color: #454F63!important; 
603	  font-weight: 600!important; 
604
605	 
606	.tema-ativo{ 
607	  background-color: #F7BD23!important; 
608			color: #454F63!important; 
609	  font-weight: 600!important; 
610
611 
612		.ssp:not(.liferay-instance) .ssp-section-tema__container-menu-item .tema:hover { 
613			background-color: #F7BD23; 
614			color: white; 
615			font-weight: 600 !important; 
616
617		 
618		.subtema.btn-nivel-3.subtema-ativo { 
619			background: #F7BD23!important; 
620			color: white!important; 
621			border-color: #F7BD23!important; 
622
623 
624	</style> 
625 
626</#if> 
627 
628<style> 
629 
630/* css para link no nome da unidade */ 
631 
632.ssp-header-unidade__title a{ 
633     
634    text-decoration: none!important; 
635    font-family: Montserrat; 
636    font-size: 44px; 
637    max-width: 440px; 
638    font-weight: 600!important; 
639    line-height: 1.23; 
640    text-align: left; 
641    color: white; 
642
643 
644.ssp-section-tema__subtitle-curso-section { 
645 
646	margin-left: 40px!important; 
647 
648
649 
650.ssp-page-busca__section-resultado__ver-todos{ 
651	margin-right: 40px!important; 
652
653 
654.submenu-tema-ativo{ 
655  background-color: #34495e!important; 
656  color:white!important; 
657  font-weight: 600!important; 
658
659 
660.submenu-tema-ativo-hover{ 
661  background-color: #34495e!important; 
662  color:white!important; 
663  font-size:50px; 
664  font-weight: 600!important; 
665
666 
667.subtema.btn-nivel-3.subtema-ativo{ 
668	background:#a2acc3!important; 
669	color:white!important; 
670
671 
672.slider-curso>.slick-area__item{ 
673 
674width:100%; 
675	 
676
677 
678.custom-card-curso-tema{ 
679  
680 height:288px!important;  
681   
682
683 
684@media only screen and (max-width: 768px){ 
685	 
686  .ssp:not(.liferay-instance) .custom-card-curso-tema { 
687      width: 100% !important; 
688      height:auto!important; 
689
690   
691   
692  .ssp-page-busca__section-resultado__ver-todos { 
693    display:none; 
694
695   
696  .filtroInscBolsa{ 
697  	display:none!important; 
698
699   
700
701   
702.ssp:not(.liferay-instance) .ssp-container__cursos-sem-slick { 
703    display: flex; 
704    justify-content: center; 
705    flex-wrap: wrap; 
706
707 
708/*Novas funcionalidades*/ 
709	#filtro-temas-nivel-3{ 
710		padding-bottom: 2em; 
711
712	 
713 .switch { 
714          position: relative; 
715          display: inline-block; 
716          width: 63px; 
717          height: 31.5px; 
718          margin: 0; 
719
720         
721        .switch input {  
722          opacity: 0; 
723          width: 0; 
724          height: 0; 
725
726         
727        .slider { 
728          position: absolute; 
729          cursor: pointer; 
730          top: 0; 
731          left: 0; 
732          right: 0; 
733          bottom: 0; 
734          background-color: #ccc; 
735          -webkit-transition: .4s; 
736          transition: .4s; 
737
738         
739        .slider:before { 
740          position: absolute; 
741          content: ""; 
742          height: 21px; 
743          width: 21px; 
744          left: 7px; 
745          bottom: 5.5px; 
746          background-color: white; 
747          -webkit-transition: .4s; 
748          transition: .4s; 
749
750         
751        input:checked + .slider { 
752          background-color: #5ACC75; 
753
754         
755        input:focus + .slider { 
756          box-shadow: 0 0 1px #5ACC75; 
757
758         
759        input:checked + .slider:before { 
760          -webkit-transform: translateX(26px); 
761          -ms-transform: translateX(26px); 
762          transform: translateX(26px); 
763
764         
765        /* Rounded sliders */ 
766        .slider.round { 
767          border-radius: 35px; 
768
769         
770        .slider.round:before { 
771          border-radius: 50%; 
772
773 
774        /* content filter */ 
775 
776        .ssp-slider-check__container{ 
777 
778            display: flex; 
779            justify-content: flex-end; 
780 
781
782 
783        .ssp-slider-check__content-itens{ 
784 
785            display: flex; 
786            width: 640px!important; 
787            justify-content: space-between; 
788             
789
790 
791        .ssp-slider-check__content-item{ 
792 
793            display: flex; 
794            align-items: center; 
795 
796
797 
798        .ssp-slider-check__label{ 
799 
800            font-family: Montserrat; 
801            color: #78849E; 
802            font-size: 16px; 
803            padding-left: 10px; 
804            font-weight: 600; 
805 
806
807		 
808        .ssp-section-tema__container-menu { 
809            padding-bottom: 15px; 
810
811 
812		.ssp-section-tema__subtitle-desconto{ 
813			display: block; 
814			font-size: 30px; 
815
816 
817        @media only screen and (max-width: 1024px) { 
818 
819			.ssp-section-tema__subtitle-desconto{ 
820				font-size: 19px; 
821
822 
823			.ssp-header-unidade__title a{ 
824				 
825				font-size: 24px; 
826
827 
828			.ssp-section-tema__subtitle-curso-section { 
829 
830				margin-left: 0px!important; 
831 
832
833 
834            #filtro-ativo-nivel-2{ 
835                justify-content: center; 
836
837 
838            .ssp-slider-check__label{ 
839 
840                font-size: 11px; 
841 
842
843 
844            .tema-slick-area { 
845     
846                display: flex; 
847                align-items: center; 
848                justify-content: flex-start; 
849                font-size: 0; 
850                flex-wrap: wrap; 
851
852 
853            /* custom  itens */ 
854			 
855			 
856            .ssp-unidade-temas__label-filtre-por{ 
857                font-size: 15px!important; 
858    			padding-left: 5px!important; 
859
860            
861 
862            .ssp-section-tema__container-menu { 
863                height: auto!important; 
864
865 
866            .tema-slick-area-mobile { 
867                display: flex; 
868                align-items: center; 
869                justify-content: center; 
870                font-size: 0; 
871                flex-wrap: wrap; 
872
873 
874            .ssp-section-tema__container-submenu-nivel3 { 
875 
876                justify-content: center; 
877
878             
879             .ssp-slider-check__container{ 
880            	padding-top:10px!important; 
881
882      }      
883</style> 
884 
885<#if tipoCurso == "Livre"> 
886 
887	<style>     
888		@media only screen and (max-width: 768px){      
889			.tema-ativo::after{ 
890				font-family: "Font Awesome 5 Free";  
891				font-weight: 900;  
892				content: "\f00d"; 
893				font-size: 12px; 
894				margin: 0 5px; 
895
896
897	</style>             
898</#if> 
899<style> 
900		@media only screen and (max-width: 768px){      
901			.subtema-ativo::after{ 
902				font-family: "Font Awesome 5 Free";  
903				font-weight: 900;  
904				content: "\f00d"; 
905				font-size: 12px; 
906				margin: 0 5px; 
907
908             
909            .ssp:not(.liferay-instance) .ssp-page-busca__section-resultado__ver-todos-mobile { 
910			    font-family: Montserrat; 
911			    font-size: 16px; 
912			    font-weight: 600; 
913			    line-height: 1.21; 
914			    color: #78849e; 
915			    text-decoration: none !important; 
916			    transition: 0.3s; 
917			    text-align: center !important; 
918   				 padding-left: 7em; 
919
920			 
921			.ssp:not(.liferay-instance) .ssp-page-busca__section-resultado__ver-todos-mobile::after { 
922			    font-family: FontAwesome; 
923			    font-weight: 900; 
924			    content: '\f054'; 
925			    font-size: 12px; 
926			    margin-left: 5px; 
927
928 
929
930 
931        /* Custom css para unidades */ 
932 
933        .ssp-unidade-temas__label-filtre-por{ 
934 
935            font-family: Montserrat; 
936            font-size: 20px; 
937            font-weight: 600; 
938            padding: 15px; 
939            padding-left: 30px; 
940            color: #78849E; 
941 
942
943 
944        .ssp-section-tema__container-submenu-nivel3 .btn-nivel-3 { 
945            margin: 15px 10px; 
946           
947
948 
949 
950        .ssp-line-nivel-divisor { 
951            width: 100%; 
952            height: 1px; 
953            background: #78849E; 
954            margin: 15px 0; 
955
956 
957     .ssp-header-unidade__content-info{ 
958            z-index: 0!important; 
959
960 
961        .ssp-btn-tema-mobile--active{ 
962            background-color: #FE9057!important; 
963            color: white!important; 
964
965 
966        .ssp-btn-tema-mobile--active::after{ 
967            font-family: "Font Awesome 5 Free";  
968            font-weight: 900;  
969            content: "\f00d"; 
970            font-size: 12px; 
971            margin: 0 5px; 
972
973 
974        .ssp-btn-subtema-mobile--active{ 
975            background-color: #78849E!important; 
976            color: white!important; 
977
978         
979        
980 
981        /* Botão Visualizar mais */ 
982 
983        .ssp-btn__visualizar-mais-content{ 
984            display: flex; 
985            flex-wrap: nowrap; 
986            align-items: center; 
987            justify-content: center; 
988
989 
990        .ssp-btn__visualizar-mais{ 
991            cursor: pointer; 
992            font-size: 14px; 
993
994         
995        #visualizar-mais{ 
996        	font-family:montserrat; 
997
998		 
999		.tema{ 
1000			box-shadow: none !important; 
1001
1002		.separador-subtemas{ 
1003			margin:10px 0px 30px 0px!important; 
1004
1005		 
1006		.py-5{ 
1007			padding-bottom: 0px!important; 
1008			padding-top: 5px!important; 
1009
1010		 
1011		.ssp-section-tema__title{ 
1012			margin: 40px 0px 25px 0px!important; 
1013
1014@media only screen and (min-width: 1025px){ 
1015	.ssp-section-tema__container-submenu-nivel3 .btn-nivel-3 { 
1016		margin-bottom: 20px!important; 
1017
1018	 
1019	.filtroTextoMobile{ 
1020		display: none; 
1021
1022}  
1023 
1024.ssp-section-tema__title{ 
1025	margin: 40px 0px 25px 0px!important; 
1026
1027 
1028.py-5{ 
1029	padding-bottom: 0px!important; 
1030	padding-top: 5px!important; 
1031
1032 
1033.ssp-slider-check__content-itens{ 
1034	display: flex; 
1035	width: 800px!important; 
1036	justify-content: flex-end!important; 
1037
1038 
1039.ssp-slider-check__content-item{ 
1040	display: flex; 
1041	align-items: center; 
1042	padding: 0 20px; 
1043
1044 
1045/* novo botao ver todos os cursos */ 
1046 
1047.ver-todos-cursos-link{ 
1048	color: #78849E!important; 
1049
1050 
1051.ver-todos-cursos-link:hover{ 
1052	color: #515A6B!important; 
1053
1054 
1055.ver-todos-cursos-link:hover p{ 
1056	color: #515A6B!important; 
1057
1058 
1059.custom-card-curso-tema{ 
1060  
1061 height:282px!important;  
1062   
1063
1064 
1065.container-fluid .row{ 
1066	margin: 0 !important; 
1067
1068 
1069 
1070.container-fluid .col-md-12{ 
1071	padding: 0 !important; 
1072
1073 
1074.ver-todos-no-click{ 
1075	text-decoration: none !important; 
1076	pointer-events: none !important; 
1077
1078 
1079.slick-area__item.card-curso-nivel-2 .custom-card-curso-tema__title{ 
1080	height: 70px; 
1081
1082 
1083/*novo forma de exibir o menu de areas*/ 
1084 
1085.ssp:not(.liferay-instance) .ativo { 
1086    background-color: #F7BD23!important; 
1087    color: #454F63!important; 
1088    font-weight: 600 !important; 
1089
1090 
1091.ssp:not(.liferay-instance) .ssp-section-tema__container-menu-item .tema { 
1092	font-size: 15px; 
1093	color: #454F63; 
1094
1095 
1096.ssp:not(.liferay-instance) .ssp-section-tema__container-menu-item .tema:hover { 
1097    background-color: #F7BD23; 
1098	color: #454F63!important; 
1099    font-weight: 600 !important; 
1100
1101 
1102.ssp:not(.liferay-instance) .ssp-section-tema__container-menu { 
1103    flex-wrap: wrap; 
1104
1105 
1106.tema i{ 
1107	margin-right: 8px; 
1108
1109 
1110.subtema.btn-nivel-3.subtema-ativo { 
1111    background: #F7BD23!important; 
1112	color: #454F63!important; 
1113	border-color: #F7BD23!important; 
1114
1115 
1116.ssp:not(.liferay-instance) .ssp-section-tema__container-submenu-nivel3 .btn-nivel-3 { 
1117font-weight: 600; 
1118color: #454F63; 
1119
1120 
1121/* Transporte próximo */ 
1122 
1123.ssp:not(.liferay-instance) .ssp-header-unidade__estacionamento { 
1124    display:block; 
1125    padding-top: 5px; 
1126
1127 
1128.ssp:not(.liferay-instance) .ssp-header-unidade__endereco-container { 
1129    display: flex; 
1130    align-items: center; 
1131    justify-content: space-between; 
1132    flex-flow: column; 
1133    align-items: flex-start; 
1134    gap: 15px; 
1135
1136 
1137.ssp:not(.liferay-instance) .ssp-header-unidade__estacionamento a{ 
1138    color:white; 
1139
1140 
1141.ssp:not(.liferay-instance) .ssp-header-unidade__estacionamento a:hover{ 
1142    font-weight:normal!important; 
1143
1144 
1145.ssp:not(.liferay-instance) .ssp-header-unidade__estacionamento p{ 
1146    display:inline-block; 
1147    margin: 0; 
1148
1149 
1150.ssp:not(.liferay-instance) .ssp-header-unidade__endereco { 
1151    max-width: 100%; 
1152
1153 
1154@media only screen and (max-width: 768px){ 
1155 
1156    .ssp:not(.liferay-instance) .ssp-header-unidade__container-info .container { 
1157        padding: 0; 
1158
1159 
1160    .ssp:not(.liferay-instance) .ssp-header-unidade__estacionamento p{ 
1161        display:inline; 
1162        font-size: 13px; 
1163
1164
1165 
1166 
1167 
1168 
1169 
1170/* Alteracoes para 10019 */ 
1171#filtro-temas-nivel-2 .subtema.subtema-ativo:not(.todos){ 
1172  margin: 0 auto 30px auto!important; 
1173
1174#filtro-temas-nivel-2 .btn-nivel-3{ 
1175  display: inline-flex; 
1176  height: 40.061px; 
1177  padding: 16.868px; 
1178  justify-content: center; 
1179  align-items: center; 
1180  gap: 16.868px; 
1181  flex-shrink: 0; 
1182  border-radius: 8px; 
1183  border: 1.054px solid #C3CAD9; 
1184
1185.tema-ativo::after{ 
1186  font-family: "Font Awesome 5 Free";  
1187  font-weight: 900;  
1188  content: "\f00d"; 
1189  font-size: 12px; 
1190  margin: 0 5px; 
1191}   
1192.subtema-ativo:not(.subtema-ativo.todos)::after{ 
1193  font-family: "Font Awesome 5 Free";  
1194  font-weight: 900;  
1195  content: "\f00d"; 
1196  font-size: 12px; 
1197  margin: 0 5px; 
1198
1199#filtro-temas-nivel-3{ 
1200	margin-bottom: 20px; 
1201
1202#filtro-temas-nivel-3 a:not(.todos, .subtema-ativo)::after{ 
1203	content: "+"; 
1204  padding-left: 10px; 
1205  font-size: 16px; 
1206
1207.ssp:not(.liferay-instance) .ssp-section-tema__title{ 
1208	color: #78849E; 
1209  text-align: center; 
1210  font-family: Montserrat; 
1211  font-size: 32px; 
1212  font-style: normal; 
1213  font-weight: 600; 
1214  line-height: normal; 
1215
1216.ssp:not(.liferay-instance) .ssp-section-tema__title.selected { 
1217  font-size: 24px; 
1218  font-weight: 400; 
1219
1220.ssp:not(.liferay-instance) .ssp-section-tema__title::after { 
1221  display: none!important; 
1222
1223.ssp-title-filtrar-mais { 
1224  color: #454F63; 
1225  font-family: Montserrat; 
1226  font-size: 20px; 
1227  font-style: normal; 
1228  font-weight: 600; 
1229  line-height: normal; 
1230  margin-top: 58px; 
1231  margin-bottom: 24px; 
1232  margin-left: 10px; 
1233
1234#filtro-temas-nivel-3 .subtema { 
1235  border-radius: 32px; 
1236  border: 1.054px solid #C3CAD9; 
1237  display: flex; 
1238  height: 32px; 
1239  padding: 16.868px 16px; 
1240  justify-content: center; 
1241  align-items: center; 
1242  gap: 12px; 
1243  color: var(--boto, #636C7E); 
1244  text-align: center; 
1245  font-family: Montserrat; 
1246  font-size: 16px; 
1247  font-style: normal; 
1248  font-weight: 600; 
1249  line-height: normal; 
1250
1251.ssp-divider { 
1252  content: " "; 
1253  display: block; 
1254  background-color: #78849E; 
1255  width: 127px; 
1256  height: 3px; 
1257  margin: -25px auto 50px; 
1258
1259.ssp-section-tema__container-menu-item:has(.tema-ativo) { 
1260  margin-left: auto; 
1261  margin-right: auto; 
1262
1263 
1264@media only screen and (max-width: 1024px) { 
1265  .ssp-title-filtrar-mais { 
1266    color: #454F63; 
1267    font-family: Montserrat; 
1268    font-size: 18px; 
1269    font-style: normal; 
1270    font-weight: 600; 
1271    line-height: normal; 
1272    margin-top: 48px; 
1273    margin-bottom: 40px; 
1274    margin-left: 0px; 
1275
1276  .ssp:not(.liferay-instance) .ssp-section-tema__title { 
1277    color: #78849E; 
1278    text-align: center; 
1279    font-family: Montserrat; 
1280    font-size: 21px; 
1281    font-style: normal; 
1282    font-weight: 700; 
1283    line-height: normal; 
1284
1285 
1286  .ssp:not(.liferay-instance) .ssp-section-tema__title.selected { 
1287    font-size: 16px; 
1288    font-weight: 400; 
1289
1290 
1291  .ssp-divider { 
1292    margin: 0px auto 30px; 
1293
1294
1295</style>      
1296      
1297<#assign assetVocabularyLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetVocabularyLocalService")> 
1298<#assign assetCategoryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryLocalService")> 
1299<#assign groupId = themeDisplay.getSiteGroupId()> 
1300 
1301<#assign vocabularyTemaMercadologico = assetVocabularyLocalService.getGroupVocabulary(groupId, "Tema(Mercadológico)")> 
1302 
1303<input type="hidden" id="ssp-vocabulary-id-tema-mercadologico" value="${vocabularyTemaMercadologico.getVocabularyId()}"> 
1304      
1305      
1306<#--  Header da Unidade  --> 
1307 
1308 
1309<section style="position:relative;"> 
1310    <div class="ssp-header-unidade__imagem-box">     
1311        <div class="ssp-header-unidade__imagem-box-box-linha"></div> 
1312 
1313        <div class="ssp-header-unidade__imagem-box-box-linha2"></div> 
1314 
1315		<div id="slider">      
1316 
1317            <div class="ssp-header-unidade__imagem-box-imagem selected" style="background-image: url(${imagem.url})">                 
1318 
1319            </div> 
1320        
1321            <#if endereco2?length != 0> 
1322 
1323                <div class="ssp-header-unidade__imagem-box-imagem" style="background-image: url(${imagem2.url})"></div>     
1324 
1325            </#if>     
1326                 
1327             
1328                 
1329        </div> 
1330        <!--div class="ssp-header-unidade__imagem-box-imagem" style="background-image: url(img/bg-fale-com-gente.jpg)"></div--> 
1331 
1332		<#--  dados de compartilhamento  --> 
1333		<@liferay_util["html-top"]> 
1334			<meta name="image" property="og:image" content="${imagem.url}"> 
1335			<meta property="og:image:width" content="1024"> 
1336		</@> 
1337		<#--  dados de compartilhamento  --> 
1338	 
1339		<#if tipoCurso == "Livre" > 
1340			<div class="ssp-header-tema__tag-tipo-curso"></div> 
1341		<#else> 
1342        	<!-- Tag de Tipo de Curso --> 
1343        	<div class="ssp-header-tema__tag-tipo-curso bg-nivel-tecnico"></div> 
1344			 
1345		</#if> 
1346        <div class="ssp-header-unidade__container-info"> 
1347 
1348            <div class="container"> 
1349 
1350                <div class="ssp-header-unidade__content-info" style="height: auto;"> 
1351 
1352                    <div class="ssp-header-unidade__content-info-container"> 
1353 
1354                        <div> 
1355 
1356                            <div> 
1357                                <small class="ssp-header-unidade__subtitle">Senac</small> 
1358                            </div> 
1359 
1360                            <div class="ssp-header-unidade__title-container"> 
1361 
1362                                <div> 
1363 
1364                                    <h1 class="ssp-header-unidade__title"> 
1365					<a href="https://www.sp.senac.br/${friendlyUrlUnidade}"> 
1366											${nome} 
1367										</a>	 
1368									</h1> 
1369									 
1370 
1371								</div> 
1372								 
1373                                <#-- o código da unidade é usado para referência de unidade no --> 
1374                                <span id="codUnidadeReferencia" class="d-none">${codigoUnidade}</span> 
1375                                <span id="friendlyUnidade" class="d-none">${friendlyUrlUnidade}</span> 
1376                                <span id="friendlyTipoCurso" class="d-none">${friendlyUrlTipoCurso}</span> 
1377                                <span id="nomeUnidadeParaBreadCrumb" class="d-none">${nomeUnidadeParaBreadCrumb}</span> 
1378								 
1379								<#if friendlyUrlTipoCurso?contains("livre")> 
1380                                 	<span id="tipoCursoText" class="d-none">Livre</span> 
1381                                <#else> 
1382                                  	<span id="tipoCursoText" class="d-none">Técnico</span> 
1383                               </#if> 
1384                            	<#if friendlyUrlTemaFirst?contains("#erro#")> 
1385                                 	<span id="friendlyTemaNv1" class="d-none"></span> 
1386                                 <#else> 
1387                                  	<span id="friendlyTemaNv1" class="d-none">${friendlyUrlTemaFirst}</span> 
1388                               </#if> 
1389                                <#if friendlyUrlTemaSecond?contains("#erro#")> 
1390                                 	<span id="friendlyTemaNv2" class="d-none"></span> 
1391                                <#else> 
1392                                  <span id="friendlyTemaNv2" class="d-none">${friendlyUrlTemaSecond}</span> 
1393                               </#if> 
1394                               <#if friendlyUrlTemaThird?contains("#erro#")> 
1395                                 	<span id="friendlyTemaNv3" class="d-none"></span> 
1396                                 <#else> 
1397                                 	 <span id="friendlyTemaNv3" class="d-none">${friendlyUrlTemaThird}</span> 
1398                               </#if> 
1399                                
1400                            </div> 
1401 
1402                        </div> 
1403 
1404                        <div class="ssp-header-unidade__endereco-container"> 
1405 
1406                            <div class="d-flex flex-wrap"> 
1407                                 
1408								<div> 
1409								 
1410									<#if endereco2?length != 0> 
1411										<span class="ssp-header-title-bloco">Bloco I</span><br> 
1412									</#if> 
1413 
1414									<address class="ssp-header-unidade__endereco"> 
1415										${endereco}, ${numero}<br>  
1416										${bairro}, ${cidade} - ${UF}, ${cep} 
1417									</address> 
1418 
1419									<span class="ssp-header-unidade__estacionamento"> 
1420 
1421									<i class="fas fa-car"></i> 
1422 
1423										<#if estacionamento?contains("true")> 
1424											<strong>Possui estacionamento?</strong> Sim 
1425											<#else> 
1426											<strong>Possui estacionamento?</strong> Não 
1427										</#if> 
1428 
1429									</span> 
1430								</div> 
1431 
1432								<#if endereco2?length != 0> 
1433 
1434									<div class="pt-5"> 
1435										<span class="ssp-header-title-bloco">Bloco II</span><br> 
1436										<address class="ssp-header-unidade__endereco"> 
1437											${endereco2}, ${numero2}<br>  
1438											${bairro2}, ${cidade2}, ${cep2} 
1439										</address> 
1440										<span class="ssp-header-unidade__estacionamento"> 
1441											<i class="fas fa-car"></i> 
1442 
1443												<#if estacionamento2?contains("true")> 
1444													<strong>Possui estacionamento?</strong> Sim 
1445													<#else> 
1446													<strong>Possui estacionamento?</strong> Não 
1447												</#if> 
1448 
1449										</span> 
1450									</div> 
1451 
1452								</#if> 
1453 
1454								<#if hasEstacaoProxima> 
1455                                            
1456									<span class="ssp-header-unidade__estacionamento"> 
1457										<i class="fa-solid fa-train-subway" aria-hidden="true"></i> 
1458										<strong>Estação mais próxima:</strong> 
1459										${estacaoProxima} 
1460									</span> 
1461 
1462								</#if> 
1463 
1464							</div>   
1465 
1466                            <div class="ssp-header-unidade__content-info-maps"> 
1467 
1468 
1469                                <a class="btn btn-nivel border-white ssp-header-unidade__btn" href="${googlemaps}" target="_blank"> 
1470                                    <i class="fas fa-map-marker-alt mr-2 ssp-header-unidade__btn-icon"></i>Google Maps 
1471                                </a> 
1472 
1473	                            <a class="btn btn-nivel border-white ml-2  d-sm-inline-block d-md-none d-lg-none d-xl-none ssp-header-unidade__btn" href="${waze}" target="_blank"> 
1474                                    <i class="fab fa-waze mr-2 ssp-header-unidade__btn-icon"></i>Waze 
1475                                </a> 
1476 
1477                            </div>                         
1478                             
1479                        </div> 
1480 
1481                    </div> 
1482 
1483                    <div class="ssp-header-unidade__content-info-body"> 
1484 
1485                        <div class="ssp-header-unidade__atendimento-container"> 
1486                            <p><strong>Atendimento:</strong></p> 
1487	                        <p>${horario}</p> 
1488                        </div> 
1489                         
1490                    </div> 
1491 
1492                     
1493            </div> 
1494             
1495        </div> 
1496 
1497        </div>  
1498                     
1499    </div> 
1500         
1501 
1502<script> 
1503     
1504    if ( $.trim($('.ssp-header-unidade__title').html()) === 'Santo Amaro'){ 
1505 
1506    $('.ssp-header-unidade__subtitle').html('Centro Universitário Senac') 
1507 
1508    } else if ( $.trim($('.ssp-header-unidade__title').html()) === 'Campos do Jordão'){ 
1509 
1510        $('.ssp-header-unidade__subtitle').html('Centro Universitário Senac') 
1511 
1512    } else if ( $.trim($('.ssp-header-unidade__title').html()) === 'Águas de São Pedro'){ 
1513 
1514        $('.ssp-header-unidade__subtitle').html('Centro Universitário Senac') 
1515 
1516
1517 
1518//Animação de Crédito da imagem 
1519 
1520$(document).ready(function(){   
1521    init() 
1522 
1523    let larguraTela = $(window).width(); 
1524 
1525    if(larguraTela < 1024){ 
1526 
1527        animateCreditImage() 
1528 
1529        $(window).scroll(function() { 
1530            ScrollPagina() 
1531        }); 
1532 
1533    }else{ 
1534 
1535        $(".ssp-header-unidade__imagem-box-imagem" ).mouseover(function() { 
1536            $(".creditoFotoMob").removeClass('d-none') 
1537         
1538        });   
1539 
1540        $(".ssp-header-unidade__imagem-box-imagem" ).mouseout(function() { 
1541                $(".creditoFotoMob").addClass('d-none') 
1542                 
1543        });  
1544 
1545
1546 
1547    //verifica posição do Top 
1548 
1549    function ScrollPagina(){ 
1550 
1551        let scrollPage = $(window).scrollTop(); 
1552 
1553        if(scrollPage == 0){ 
1554 
1555            animateCreditImage() 
1556 
1557
1558
1559 
1560    function animateCreditImage(){ 
1561 
1562        $( ".creditoFotoMob" ).removeClass('d-none').fadeIn( 200 ).delay( 2500 ).fadeOut( 5000 ); 
1563 
1564
1565 
1566    //anima Slider fotos unidades de 
1567 
1568    let time = 5000, 
1569        currentImageIndex = 0, 
1570        images = document 
1571                    .querySelectorAll("#slider .ssp-header-unidade__imagem-box-imagem") 
1572        max = images.length; 
1573 
1574    function nextImage() { 
1575 
1576        images[currentImageIndex] 
1577            .classList.remove("selected") 
1578 
1579        currentImageIndex++ 
1580 
1581        if(currentImageIndex >= max) 
1582            currentImageIndex = 0 
1583 
1584        images[currentImageIndex] 
1585            .classList.add("selected") 
1586
1587 
1588    function start() { 
1589 
1590        let enderecos = document.querySelectorAll('address'); 
1591 
1592        if(enderecos.length >= 2){     
1593 
1594            setInterval(() => { 
1595                // troca de image 
1596                nextImage() 
1597            }, time) 
1598
1599        
1600
1601 
1602    window.addEventListener("load", start) 
1603 
1604	//Associa eventos 
1605	$(document).on("click", ".ver-todos-cursos-link", verTodosCursos); 
1606	$(document).on("click", ".card-ver-todos-cursos-link", verTodosCursos); 
1607});  
1608     
1609</script> 
1610	 
1611 
1612     
1613</section> 
1614 
1615<!--  Fim Header Unidade --> 
1616 
1617 
1618      
1619<#--  Conteúdo dinâmico que carrega os temas, subtemas e cursos  --> 
1620 
1621<section> 
1622 
1623	<div> 
1624 
1625		<h2 class="ssp-section-tema__title" data-section="title"> 
1626			Qual a sua área de interesse? 
1627    </h2> 
1628 
1629    <div class="ssp-divider"></div> 
1630 
1631		<div class="container"> 
1632 
1633			<div id="temas" class="ssp-section-tema__container-menu"> 
1634 
1635				<div class="ssp-section-tema__container-menu-item"> 
1636					<a href="#a" class="tema todos" data-nvl="0"> 
1637						<i class="fa-solid fa-dice-d6"></i> 
1638						Todos 
1639					</a> 
1640				</div> 
1641 
1642			</div> 
1643 
1644			<!-- Botão Visualizar Mais --> 
1645 
1646			<div class="ssp-btn__visualizar-mais-content d-md-none d-lg-none d-xl-none"> 
1647 
1648				<p id="visualizar-mais" class="ssp-btn__visualizar-mais">Visualizar mais</p> 
1649 
1650				<i class="fas fa-chevron-down mx-2 visualizar-mais-seta" style="font-size: 14px;"></i> 
1651				 
1652			</div> 
1653 
1654			<!-- filtros ativos para Mobile --> 
1655 
1656			<div id="filtro-ativo" class="tema-slick-area-mobile py-2"> 
1657 
1658				<!-- filtro nivel 1 --> 
1659				<div id="filtro-ativo-nivel-1" class="ssp-section-tema__container-menu-item mega-menu"> 
1660					 
1661				</div> 
1662 
1663				<div id="filtro-ativo-nivel-2" class="container ssp-section-tema__container-submenu-nivel3"> 
1664							 
1665				</div> 
1666 
1667			</div> 
1668 
1669		</div> 
1670 
1671	</div> 
1672 
1673</section> 
1674 
1675<section  id="tema-nivel2-container"> 
1676	 
1677	<div id="tema-atual"> 
1678    <h2 class="ssp-section-tema__title"></h2> 
1679    <div class="ssp-divider"></div> 
1680  </div> 
1681		 
1682	<#--   
1683	<div id="subtemas-lista-mobile" 
1684		class="container d-none ssp-section-tema__container-submenu-nivel3"></div>  --> 
1685 
1686	<div id="filtro-temas-nivel-2" class="container ssp-section-tema__container-submenu-nivel3 d-none"></div> 
1687	 
1688	<div id="filtro-temas-nivel-3" class="container ssp-section-tema__container-submenu-nivel3 d-none"></div> 
1689 
1690</section> 
1691 
1692<section id="cursos-por-categoria-container" 
1693	style="padding-bottom:30px"> 
1694 
1695	<section class="py-5"> 
1696 
1697		<div class="container"> 
1698			<!-- <hr class="filtroInscBolsa"> --> 
1699			<div class="ssp-slider-check__container" style="padding: 20px 0px;" id="container-filtros"> 
1700				<div class="ssp-slider-check__content-itens"> 
1701					 
1702					<div class="ssp-slider-check__content-item"> 
1703 
1704						<label id="inscricao-aberta" class="switch"> 
1705							<input id="chkInscricao" type="checkbox"> 
1706							<span class="slider round"></span> 
1707						</label> 
1708			 
1709						<span class="ssp-slider-check__label">Comprar agora</span> 
1710 
1711					</div>					 
1712	 
1713					<div class="ssp-slider-check__content-item"> 
1714	 
1715						<label id="bolsas-estudo" class="switch"> 
1716							<input id="chkBolsa" type="checkbox"> 
1717							<span class="slider azul round"></span> 
1718						</label> 
1719			 
1720						<span class="ssp-slider-check__label">Bolsas de estudo</span> 
1721	 
1722					</div> 
1723	 
1724				</div>     
1725 
1726			</div> 
1727 
1728			<!-- <hr class="filtroInscBolsa"> --> 
1729		</div> 
1730		 
1731	</section> 
1732 
1733  <div style="padding-bottom: 30px;"> 
1734 
1735    <section id="cursos-por-subtema-container" class="container d-none"> 
1736   
1737      <!--h2 id="subtema-atual" class="ssp-section-tema__title-subtema"></h2--> 
1738       
1739      <div id="subsubtemas-lista"   class="ssp-section-tema__container-submenu-nivel3"></div> 
1740       
1741      <div id="curso-sem-slick" class="ssp-container__cursos-sem-slick"></div> 
1742       
1743       
1744    </section> 
1745   
1746  </div> 
1747 
1748	<div id="filtroSemCurso" class="ssp-bolsa-formulario__card-aviso-atencao d-none container text-left" style="width: 100%;"> 
1749                     
1750        <i class="fas fa-exclamation-circle ssp-bolsa-formulario__card-aviso-atencao-icon" aria-hidden="true"></i> 
1751     
1752        <div class="ssp-bolsa-formulario__card-aviso-texto""><p>Sem cursos para o filtro selecionado</p> 
1753        </div> 
1754     
1755     </div> 
1756	 
1757	 
1758</section> 
1759 
1760 
1761<#-- Template para card de cursos por categoria --> 
1762<section id="cursos-por-categoria-template" 
1763	class="cursos-por-categoria ssp-section container d-none"> 
1764 
1765 
1766	<div class="ssp-page-busca__section-resultado-container" 
1767		id="container-slider-cursos-livres"> 
1768 
1769		<a href="#a" data-nvl="" data-tema="" 
1770			class="ver-todos-cursos-link d-none-mobile"> 
1771		<p 
1772			class="ssp-page-busca__section-resultado__title-outros tema-nome ssp-section-tema__subtitle-curso-section"></p></a> 
1773			 
1774	</div> 
1775 
1776	<div class="slider-curso" style="display: flex;"></div> 
1777 
1778</section> 
1779 
1780<#-- Section para o item de curso--> 
1781<div id="curso-item-template" class="d-none slick-area__item"> 
1782 
1783	<div class="ssp-card-curso custom-card-curso-tema"> 
1784 
1785		<a class="ssp-absolute-link ck-curso" href="#a"></a> 
1786 
1787		<div class="ssp-card-curso__image custom-card-curso-tema__image"> 
1788 
1789			<div class="ssp-image-container"> 
1790				<img src="" /> 
1791 
1792			</div> 
1793 
1794		</div> 
1795 
1796		<div class="ssp-card-curso__body custom-card-curso-tema__body"> 
1797        	<!-- Tag de Tipo de Curso --> 
1798			<#if tipoCurso == "Livre" > 
1799				<div class="ssp-card-curso__color-tag-modalidade bg-nivel-livre custom-card-curso-tema__color-tag-modalidade"></div> 
1800			<#else> 
1801     			<div class="ssp-card-curso__color-tag-modalidade bg-nivel-tecnico custom-card-curso-tema__color-tag-modalidade"></div> 
1802			 
1803			</#if> 
1804			 
1805 
1806			<div class="ssp-card-curso__tags custom-card-curso-tema__tags"> 
1807 
1808				<span class="ssp-card-curso__tag-formato-title">${tipoCurso}</span> 
1809				 
1810				<span class="tag-modalidade-title__senac-online d-none">Senac Online - ao vivo</span> 
1811 
1812			</div> 
1813 
1814			<h6 class="ssp-card-curso__title custom-card-curso-tema__title"> 
1815 
1816			</h6> 
1817 
1818			<div class="ssp-card-curso__info custom-card-curso-tema__info"> 
1819 
1820				<span 
1821					class="ssp-tag bg-white border-nivel-extensao text-nivel-extensao mr-1 btn-inscricoes-abertas">Inscrições 
1822					abertas</span> <span 
1823					class="ssp-tag bg-white border-primary text-primary btn-bolsas">Bolsas</span> 
1824 
1825			</div> 
1826						 
1827		</div> 
1828 
1829	</div> 
1830 
1831</div> 
1832 
1833<#--  Estrutura com botões de tipos de curso -  os únicos que precisam ser dinâmicos são Livre e Técnico  --> 
1834 
1835<section class="ssp-section ssp-section-lg-top"> 
1836 
1837 
1838    <div class="container text-left"> 
1839 
1840        <h2 class="ssp-section-title"> 
1841            <lfr-editable id="title" type="rich-text"> 
1842                Cursos oferecidos 
1843            </lfr-editable> 
1844        </h2> 
1845     
1846        <div class="ssp-btns-horizontal-area"> 
1847 
1848			<#function getCategorias primaryKey> 
1849   
1850			<#assign categoryService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryLocalService") /> 
1851			<#attempt> 
1852		   
1853				<#return categoryService.getCategories("com.liferay.journal.model.JournalArticle", primaryKey)> 
1854		   
1855			<#recover> 
1856			   
1857			  <#return '#erro#'> 
1858			</#attempt> 
1859		  </#function> 
1860 
1861			<#assign  
1862			 
1863 
1864				categoriesList = getCategorias(journal.getResourcePrimKey())  
1865				normalizer = serviceLocator.findService("com.liferay.portal.kernel.util.FriendlyURLNormalizer")  
1866				vocabularyLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetVocabularyLocalService") 
1867				vocabularies = vocabularyLocalService.getAssetVocabularies(-1,-1) 
1868				 
1869			/> 
1870 
1871 
1872			<#list vocabularies as vocabulary > 
1873			<#if vocabulary.getName() == 'Unidades'> 
1874				 
1875				<#assign  
1876					xPathSelector_nomeUsualUnidade = saxReaderUtil.createXPath("dynamic-element[@name='nomeUsualUnidade']") 
1877					  nomeUsual = xPathSelector_nomeUsualUnidade.selectSingleNode(rootElement).getStringValue() 
1878					  categories = vocabulary.getCategories() 
1879
1880				<#list categories as category> 
1881					<#if  category.getName()?trim == nomeUsual?trim> 
1882						 
1883						<#assign categoryId = category.getCategoryId() > 
1884					</#if> 
1885				</#list> 
1886			</#if> 
1887		</#list> 
1888 
1889 
1890 
1891		<#-- Prefixo EAD--> 
1892        <#assign xPathSelector_urlEAD = saxReaderUtil.createXPath("dynamic-element[@name='prefixourlead']")> 
1893        <#assign prefixoURLEAD = xPathSelector_urlEAD.selectSingleNode(rootElement).getStringValue()> 
1894 
1895        <#assign  hasPrefixoUrlEad = (prefixoURLEAD?trim?length > 0) > 
1896 
1897 
1898			<#list categoriesList![] as category> 
1899  
1900                <#assign vocabularyName = vocabularyLocalService.getVocabulary(category.getVocabularyId()).getTitle("pt-br")?trim /> 
1901  
1902                <#if normalizer.normalize(vocabularyName) == "tipo-de-curso"> 
1903					<#assign normalizedCategoryName = normalizer.normalize(category.getName()) /> 
1904					 
1905					<#if category.getName() == "Livre EAD"> 
1906                    <a href="#" data-categoryId="${category.getCategoryId()}" class="btn btn-nivel btn-nivel-${normalizedCategoryName}">Senac Online<i class="fas fa-signal-stream icon-ao-vivo" aria-hidden="true"></i>ao vivo</a> 
1907                    <#else> 
1908                        <a href="#" data-categoryId="${category.getCategoryId()}" class="btn btn-nivel btn-nivel-${normalizedCategoryName}">${category.getName()}</a> 
1909                    </#if> 
1910					 
1911 
1912                </#if> 
1913  
1914			</#list> 
1915 
1916			<#-- Verifica se a unidade oferta curso de Idiomas--> 
1917 
1918                <<#list categoriesList![] as category> 
1919 
1920                    <#assign vocabularyName = vocabularyLocalService.getVocabulary(category.getVocabularyId()).getTitle("pt-br")?trim /> 
1921 
1922                    <#if normalizer.normalize(vocabularyName) == "tema-mercadologico-">  
1923 
1924						<#assign normalizedCategoryName = normalizer.normalize(category.getName()) /> 
1925 
1926						<#if category.getName() == "Idiomas"> 
1927								<a href="#" data-categoryId="${category.getCategoryId()}" class="btn btn-nivel btn-nivel-${normalizedCategoryName}">${category.getName()}</a> 
1928							<#else> 
1929						</#if> 
1930 
1931                    </#if> 
1932 
1933                </#list>  
1934 
1935            <#-- Verifica se a unidade oferta curso livre--> 
1936 
1937			 
1938			<#if hasPrefixoUrlEad > 
1939 
1940                <a href="${prefixoURLEAD}" target="_blank" class="btn btn-nivel btn-nivel-ead">EAD</a> 
1941 
1942            </#if> 
1943     
1944 
1945	</div> 
1946 
1947    </div> 
1948 
1949 
1950</section> 
1951  
1952 <script> 
1953const isMobile = $(window).width() <= 1024 
1954 
1955var temas = []; 
1956var subtemasStorage = new Map(); 
1957var activeCategory = 'all'; 
1958var activeCategoryLevel = 0; 
1959var limit = 2; 
1960var offset = 0; 
1961var todosText = ''; 
1962var limitTodosCursos = 16; 
1963var offsetTodosCursos = 0; 
1964var groupId = 0; 
1965var tipoCursoNome = "Técnico"; 
1966var tipoCursoNomeBreadCrumb = "Cursos Técnicos"; 
1967var categoryIdTipoCurso = 0; 
1968var cookieName = "ck-cursos-tecnico"; 
1969var tam = $(window).width(); 
1970var urlUnidade = ""; 
1971var urlTipoCurso = "";  
1972var urlTemasStorage = new Map(); 
1973var urlTemaNv1 = ""; 
1974var urlTemaNv2 = ""; 
1975var urlTemaNv3 = ""; 
1976var acessoDireto = 0; 
1977var categoryIdTemaNv1 = ""; 
1978var categoryIdTemaNv2 = ""; 
1979var categoryIdTemaNv3 = ""; 
1980const HOST = window.location.origin; 
1981var filtrarInscricoesAbertas = 0; 
1982var filtrarBolsaEstudo = 0; 
1983var activeModeloExibicao = 1; 
1984var limitCursos = isMobile ? 4 : 11; 
1985var cliqueFiltroMobile = 0; 
1986var idModalidadeEspecTecnica = 0; 
1987 
1988const codModalidadeEspecTecnica = 10; 
1989var urlSearchModalidadeEspecTecnica = '/o/senac-category-services/categoryByVocabularyNameAndProperty/{groupId}/Modalidade/codModalidade/' + codModalidadeEspecTecnica; 
1990var urlSearchCursos = '/o/senac-unidade-services/cursosPorCategoriaETemaEUnidade/{groupId}/{categoryTemaId}/{categoriaId}/{unidadeCategoryId}/{filtrarInscricoesAbertas}/{filtrarBolsaEstudo}/{start}/{end}'; 
1991var urlCursosPorTipoCursoETemaComFiltrosBolsaECompra = "/o/senac-content-services/cursosPorCategoriasComFiltrosBolsaECompra/{groupId}/{filtrarInscricoesAbertas}/{filtrarBolsaEstudo}/{considerarUnidade}/{start}/{end}?categoryIds={categoryTemaId}&categoryIds={categoriaId}&categoryIds={unidadeCategoryId}" 
1992var urlSearchTemas = '/o/senac-unidade-services/temasPorCategoriaEUnidade/{groupId}/{unidadeCategoryId}/{categoriaId}/{nivelTema}/{categoriaParentId}'; 
1993 
1994var urlSearchTipoCurso = '/o/senac-content-services/idTipoCursoPorNome/{groupId}/{tipoCursoNome}'; 
1995let categorias = [] 
1996let categoryWithoutCourse = [] 
1997var urlSearchTipoCursoTecnico = '/o/senac-category-services/categoryByVocabularyNameAndProperty/{groupId}/Tipo%20de%20curso/sigla/T'; 
1998let friendlyUrlUnidade = '' 
1999 
2000 
2001function montaBreadCrumb(){ 
2002	var breadCrumb = $(".breadcrumb"); 
2003	var nomeUnidade = $("#nomeUnidadeParaBreadCrumb").text().trim(); 
2004	 
2005	breadCrumb.empty(); 
2006	 
2007	//Home 
2008	breadCrumb.append('<li class="breadcrumb-item"><a class="breadcrumb-link" href="/" title="Home"><span class="breadcrumb-text-truncate">Home</span></a></li>'); 
2009	 
2010	//Unidades 
2011	breadCrumb.append('<li class="breadcrumb-item"><a class="breadcrumb-link" href="/unidades" title="Unidades"><span class="breadcrumb-text-truncate">Unidades</span></a></li>'); 
2012	 
2013	//Unidade 
2014	breadCrumb.append('<li class="breadcrumb-item"><a class="breadcrumb-link" href="/'+getFriendlyUrlUnidade()+'" title="'+nomeUnidade+'"><span class="breadcrumb-text-truncate">'+nomeUnidade+'</span></a></li>'); 
2015	 
2016	//Tipo de Curso 
2017	breadCrumb.append('<li class="breadcrumb-item"><a class="breadcrumb-link" href="/'+getFriendlyUrlUnidade()+'/'+getUrlTipoCurso()+'" title="'+tipoCursoNomeBreadCrumb+'"><span class="breadcrumb-text-truncate">'+tipoCursoNomeBreadCrumb+'</span></a></li>'); 
2018	 
2019
2020 
2021function carregaLinkTodosBotoesModalidades(){ 
2022 
2023$( document ).ready(function() { 
2024   
2025      var friendlyUrlUnidade = $("#friendlyUnidade").text().trim(); 
2026 
2027      // extensão 
2028      if (($('.ssp-btns-horizontal-area').find('.btn-nivel-extensao'))){ 
2029 
2030          $('.ssp-btns-horizontal-area').find('.btn-nivel-extensao').attr("href", "https://www.sp.senac.br/jsp/default.jsp?template=1588.dwt&testeira=725&type=X&unit=NONE&sub=") 
2031 
2032
2033 
2034      // Ensino Médio 
2035      if (($('.ssp-btns-horizontal-area').find('.btn-nivel-ensino-medio-tecnico'))){ 
2036 
2037          var urlEmed = "/"+friendlyUrlUnidade+ "/ensino-medio-tecnico"; 
2038          $('.ssp-btns-horizontal-area').find('.btn-nivel-ensino-medio-tecnico').attr("href", urlEmed); 
2039 
2040
2041 
2042 
2043      // Graduação 
2044      if (($('.ssp-btns-horizontal-area').find('.btn-nivel-graduacao'))){ 
2045         
2046        var urlGraduacao = "/"+friendlyUrlUnidade+ "/graduacao"; 
2047 
2048          $('.ssp-btns-horizontal-area').find('.btn-nivel-graduacao').attr("href", urlGraduacao); 
2049           
2050
2051 
2052      // Pos-Graduação 
2053      if (($('.ssp-btns-horizontal-area').find('.btn-nivel-pos-graduacao'))){ 
2054 
2055          $('.ssp-btns-horizontal-area').find('.btn-nivel-pos-graduacao').attr({ 
2056              href: "/"+friendlyUrlUnidade+ "/pos-graduacao", 
2057              target: "_blank" 
2058          }) 
2059 
2060
2061 
2062      // livre 
2063      if (($('.ssp-btns-horizontal-area').find('.btn-nivel-livre'))){ 
2064               
2065          var urlLiv = "/"+friendlyUrlUnidade+ "/cursos-livres"; 
2066           
2067          //Solucao temporaria, ate o proxy estiver correto 
2068          if(friendlyUrlUnidade == "senac-tatuape-luis-americano" || friendlyUrlUnidade == "centro-universitario-senac-campos-do-jordao")  
2069              urlLiv = "/busca?q=*&tipo-curso="+$('.ssp-btns-horizontal-area').find('.btn-nivel-livre').data('categoryid')+"&unidade="+${categoryId}+'#c'; 
2070           
2071      $('.ssp-btns-horizontal-area').find('.btn-nivel-livre').attr("href", urlLiv); 
2072 
2073
2074   
2075   // livre Ao vivo 
2076   if (($('.ssp-btns-horizontal-area').find('.btn-nivel-livre-ead'))){ 
2077 
2078    $('.ssp-btns-horizontal-area').find('.btn-nivel-livre-ead').attr({ 
2079 
2080      href : "https://www.sp.senac.br/cursos-livres-senac-online-ao-vivo" 
2081    }) 
2082 
2083
2084 
2085  // Regra para Botão de Idiomas 
2086 
2087      if( 
2088 
2089          $('#codUnidadeReferencia').text() === "123" ||  
2090          $('#codUnidadeReferencia').text() === "23" ||  
2091          $('#codUnidadeReferencia').text() === "58" ||  
2092          $('#codUnidadeReferencia').text() === "32" ||  
2093          $('#codUnidadeReferencia').text() === "62" && $('.ssp-btns-horizontal-area').find('.btn-nivel-idiomas') 
2094           
2095      ) { 
2096 
2097          var urlIdi = "/"+friendlyUrlUnidade+ "/cursos-livres/idiomas"; 
2098 
2099          $('.ssp-btns-horizontal-area').find('.btn-nivel-idiomas').attr("href", urlIdi); 
2100 
2101      }else{ 
2102          $('.ssp-btns-horizontal-area').find('.btn-nivel-idiomas').addClass("d-none") 
2103
2104 
2105      // Técnicos 
2106      if (($('.ssp-btns-horizontal-area').find('.btn-nivel-tecnico'))){ 
2107 
2108          var urlTec = "/"+friendlyUrlUnidade+ "/cursos-tecnicos"; 
2109           
2110      //Solucao temporaria, ate o proxy estiver correto 
2111      if(friendlyUrlUnidade == "senac-tatuape-luis-americano" || friendlyUrlUnidade == "centro-universitario-senac-campos-do-jordao")  
2112          urlTec = "/busca?q=*&tipo-curso="+$('.ssp-btns-horizontal-area').find('.btn-nivel-tecnico').data('categoryid')+"&unidade="+${categoryId}+'#c'; 
2113       
2114          $(this).find('.btn-nivel-tecnico').attr("href", urlTec); 
2115 
2116
2117 
2118      // Jovem Aprendiz 
2119      if (($('.ssp-btns-horizontal-area').find('.btn-nivel-jovem-aprendiz'))){ 
2120 
2121          $(this).find('.btn-nivel-jovem-aprendiz').attr({ 
2122              href: "/jovem-aprendiz", 
2123          }) 
2124 
2125
2126 
2127 
2128  }); 
2129 
2130 
2131
2132 
2133function carregaLinkBotoesLivreETecnico(){ 
2134 
2135  urlUnidade = $("#friendlyUnidade").text().trim(); 
2136  urlTipoCurso = $("#friendlyTipoCurso").text().trim();  
2137     
2138  $.ajax({ 
2139 
2140    url : '/o/senac-content-services/url-tipos-de-curso/'+groupId, 
2141    type : 'get', 
2142    dataType: 'json', 
2143 
2144  }).done(function(res) { 
2145    $(res).each(function(key , value){ 
2146       
2147      if(value.name == 'tecnico'){ 
2148        //botao livre 
2149        $("#linkTecnico").attr('href', "/"+urlUnidade+"/"+value.friendlyURL); 
2150         
2151      }else 
2152        if(value.name == 'livre'){ 
2153       
2154          $("#linkLivre").attr('href', "/"+urlUnidade+"/"+ value.friendlyURL); 
2155           
2156
2157       
2158     
2159    }); 
2160     
2161  }); 
2162 
2163 
2164 
2165
2166 
2167 
2168 
2169 
2170// Botao para filtro de cursos com inscricoes abertas e bolsas 
2171$('#inscricao-aberta input, #bolsas-estudo input').click(function(){ 
2172   
2173  //Atualiza as variaveis globais dos dois filtros 
2174  $("#inscricao-aberta input").is(":checked") == true ? filtrarInscricoesAbertas = 1 : filtrarInscricoesAbertas = 0; 
2175  $("#bolsas-estudo input").is(":checked") == true ? filtrarBolsaEstudo = 1 : filtrarBolsaEstudo = 0; 
2176   
2177  //Refaz a busca com os filtros atualizados 
2178  switch(getCurrentLevel()){ 
2179    case 1: 
2180    case 2:       
2181      //Verifica se esta exibindo todos ou algum tema 
2182      var botaoTodos = $('.todos'); 
2183       
2184      if(botaoTodos.hasClass('ativo') || botaoTodos.hasClass('tema-ativo'))  
2185          $('.todos:first').trigger('click'); 
2186       
2187      //Se estiver ativo um tema, verifica se possui ativo um subtema 
2188      else 
2189        //Verifica o nivel do tema clicado 
2190        $('.subtema-ativo:not(.todos)').length == 0 ? $('.subtema-ativo.todos').trigger('click') : $('.subtema-ativo:first').trigger('click', [$(this)]); 
2191        break; 
2192 
2193    case 3: 
2194      if($('#filtro-temas-nivel-3 .subtema-ativo:not(.todos)').length) { 
2195        const preSelecteds = [] 
2196        document.querySelectorAll('#filtro-temas-nivel-3 .subtema-ativo:not(.todos)') 
2197        .forEach(el => { 
2198          preSelecteds.push(el) 
2199          el.classList.remove('subtema-ativo') 
2200        }) 
2201 
2202        preSelecteds.forEach(async el => await clickTema(el.getAttribute('data-tema'))) 
2203      } else { 
2204        const el = $('#filtro-temas-nivel-3 .todos') 
2205        el.trigger('click') 
2206
2207      break; 
2208
2209}) 
2210 
2211//carrega url com tema clicado 
2212function atualizaUrlBrowser(urlTema,nivel){ 
2213	var path = window.location.pathname; 
2214	var urlFinal = ""; 
2215	 
2216	if(path.indexOf('staging') > 1){ 
2217		urlFinal = "/web/guest-staging"; 
2218	}else 
2219		if(path.indexOf('guest') > 1){ 
2220			urlFinal = "/web/guest"; 
2221
2222		 
2223	urlFinal += "/"+friendlyUrlUnidade+"/"+urlTipoCurso;	 
2224	 
2225	//se for todos os cursos a url fica so /unidade/tipo-curso 
2226	if(nivel > 0){ 
2227 
2228		switch(nivel){ 
2229		 
2230			case 1: 
2231				urlTemaNv1 = urlTema; 
2232				urlFinal += "/"+urlTemaNv1; 
2233			break; 
2234			 
2235			case 2: 
2236				urlTemaNv2 = urlTema; 
2237				if(tipoCursoNome == "Livre"){ 
2238					urlFinal += "/"+urlTemaNv1+"/"+urlTemaNv2; 
2239				}else{ 
2240					urlFinal += "/"+urlTemaNv1; 
2241
2242			break; 
2243			 
2244			case 3: 
2245				if(tipoCursoNome == "Livre"){ 
2246					urlTemaNv3 = urlTema; 
2247					urlFinal += "/"+urlTemaNv1+"/"+urlTemaNv2+"/"+urlTemaNv3; 
2248				}else{ 
2249					urlFinal += "/"+urlTemaNv1; 
2250
2251			break; 
2252		 
2253
2254		 
2255
2256 
2257	 
2258	urlFinal = new URL(window.location.origin + urlFinal); 
2259	  if($("#inscricao-aberta input").is(":checked")){ 
2260	    urlFinal.searchParams.set("inscricao", true); 
2261	  }  
2262	  if($("#bolsas-estudo input").is(":checked")){ 
2263	    urlFinal.searchParams.set("bolsa", true); 
2264	  }  
2265	  window.history.pushState('', 'Categoria JavaScript', decodeURIComponent(urlFinal.toString())) 
2266
2267 
2268function getUrlTipoCurso(){ 
2269	return $('#friendlyTipoCurso').text().trim(); 
2270
2271 
2272function buscaFriendlyUrlTemaEAtualizaBrowser(temaId, nivelClicado){ 
2273	 
2274	var friendlyUrlTema = urlTemasStorage.get(temaId); 
2275	 
2276  if(typeof  friendlyUrlTema === "undefined"){ 
2277    //se ainda nao tem no map, busco via ajax e armazeno no map a url do tema clicado para nao precisar buscar novamente 
2278		$.ajax({ 
2279      url : '/o/senac-content-services/friendlyUrlPorCategoria/'+temaId, 
2280			type : 'get', 
2281			dataType: 'json', 
2282      async: false 
2283		}).done(function(res) { 
2284       
2285      urlTemasStorage.set(temaId,res.url); 
2286			friendlyUrlTema = res.url 
2287 
2288		}) 
2289
2290 
2291  if(nivelClicado == 3){ 
2292    let params = '' 
2293 
2294    document.querySelectorAll("#filtro-temas-nivel-3 a.subtema-ativo") 
2295    .forEach(a => { 
2296      const friendlyUrl = urlTemasStorage.get(parseInt(a.getAttribute('data-tema'))) 
2297      params = (params ? params + ',' : '') + friendlyUrl 
2298    }) 
2299 
2300    atualizaUrlBrowser(params,nivelClicado); 
2301	} else { 
2302    atualizaUrlBrowser(friendlyUrlTema,nivelClicado); 
2303
2304     
2305
2306 
2307let isAcessoDireto = false 
2308//verifica se usuario acessou direto pelas urls dos temas e carrega os temas para dar sequencia 
2309async function verificaAcessoDiretoELoadTema(){ 
2310  isAcessoDireto = true 
2311  urlTemaNv1 = $("#friendlyTemaNv1").text().trim(); 
2312  urlTemaNv2 = $("#friendlyTemaNv2").text().trim(); 
2313  urlTemaNv3 = $("#friendlyTemaNv3").text().trim(); 
2314 
2315  const urlParamsTemaNv3 = new URLSearchParams(window.location.search); 
2316  urlParamTemaNv3 = urlParamsTemaNv3.get('q'); 
2317 
2318  carregaTemas() 
2319 
2320  let nivel1CategoryId 
2321  let nivel2CategoryId 
2322  let nivel3CategoryId 
2323 
2324  if(urlTemaNv1) {     
2325    getSubtemas(urlTemaNv1) 
2326    .done(categories => { 
2327      nivel1CategoryId = categories[0].categoryId 
2328      clickTema(nivel1CategoryId) 
2329    }) 
2330
2331 
2332  if(urlTemaNv2){ 
2333    getSubtemas(urlTemaNv2, nivel1CategoryId) 
2334    .done(categories => { 
2335      nivel2CategoryId = categories[0].categoryId 
2336      clickTema(nivel2CategoryId) 
2337    }) 
2338
2339 
2340  if(urlParamTemaNv3) { 
2341    const params = urlParamTemaNv3.split(',') 
2342 
2343    for (let index = 0; index < params.length; index++) { 
2344      const url = params[index]; 
2345 
2346      const categories = await getSubtemas(url, nivel2CategoryId) 
2347       
2348      await clickTema(categories[0].categoryId) 
2349
2350
2351 
2352  isAcessoDireto = false 
2353
2354 
2355function getFriendlyUrlUnidade() { 
2356  return $("#friendlyUnidade").text().trim() 
2357
2358 
2359/* Prepara a montagem inicial da página */ 
2360async function init() { 
2361  var tipoCursoText = $('#tipoCursoText').text().trim(); 
2362   
2363  if(tipoCursoText == "Livre"){ 
2364      tipoCursoNomeBreadCrumb = "Cursos Livres"; 
2365      tipoCursoNome = "Livre"; 
2366      cookieName = "ck-cursos-livre";  
2367      cardVerTodosTipoCursoClass = "livre" 
2368   
2369  }else if(tipoCursoText == "Técnico"){ 
2370      tipoCursoNomeBreadCrumb = "Cursos Técnicos"; 
2371      tipoCursoNome = "Técnico"; 
2372      cookieName = "ck-cursos-tecnico"; 
2373      cardVerTodosTipoCursoClass = "tecnico" 
2374   
2375  }else if(tipoCursoText == "Extensão"){ 
2376      tipoCursoNomeBreadCrumb = "Extensão Universitária"; 
2377      tipoCursoNome = "Extensão"; 
2378      cookieName = "ck-cursos-extensao"; 
2379      cardVerTodosTipoCursoClass = "extensao" 
2380
2381 
2382  montaBreadCrumb() 
2383 
2384  friendlyUrlUnidade = getFriendlyUrlUnidade() 
2385 
2386  const categories = await getSubtemas(friendlyUrlUnidade) 
2387  unidadeCategoryId = categories[0].categoryId 
2388   
2389	urlTipoCurso = getUrlTipoCurso(); 
2390	 
2391	groupId = Liferay.ThemeDisplay.getScopeGroupId(); 
2392	 
2393	$('#tema-atual h2').text(""); 
2394  $('#tema-atual').hide(); 
2395	 
2396	todosText = $('#tema-atual h2').text(); 
2397	 
2398		//Preenche o id do tipo de curso e a modalidade 
2399		var url = urlSearchTipoCurso 
2400		    .replace('{groupId}', groupId) 
2401		    .replace('{tipoCursoNome}', tipoCursoNome); 
2402		     
2403		$.ajax({ 
2404		    url : url, 
2405		    type : 'get', 
2406        async: false 
2407		}).done(function(categoryIdTipoCursoResponse) { 
2408		     
2409		    categoryIdTipoCurso = categoryIdTipoCursoResponse; 
2410		     
2411		}); 
2412 
2413  setCategoryIds() 
2414	carregarCategorias() 
2415  verificaFiltroInscricaoBolsaEToggle() 
2416	verificaAcessoDiretoELoadTema() 
2417  visualizarMais() 
2418  hideVisualizarMais() 
2419 
2420  if(isMobile) { 
2421    visualizarMenos() 
2422    showVisualizarMais() 
2423
2424  carregaLinkTodosBotoesModalidades(); 
2425
2426 
2427function setCategoryIds(){ 
2428		 
2429	//Obter o id da modalidade espec tecnica 
2430	var url = urlSearchModalidadeEspecTecnica 
2431		.replace('{groupId}', groupId); 
2432	 
2433	$.ajax({ 
2434		url : url, 
2435		type : 'get', 
2436    async: false 
2437	}).done(function(categoryIdModalidade) { 
2438		try{ 
2439			idModalidadeEspecTecnica = JSON.parse(categoryIdModalidade).categoryId; 
2440		}catch(err){ 
2441			console.error('idModalidadeEspecTecnica nao obtido ' + err.message); 
2442
2443		 
2444		//Obter o id do tipo curso tecnico 
2445		var url = urlSearchTipoCursoTecnico 
2446			.replace('{groupId}', groupId); 
2447		 
2448		$.ajax({ 
2449			url : url, 
2450			type : 'get', 
2451      async: false 
2452		}).done(function(categoryIdTipoCursoResponse) { 
2453			try{ 
2454        idTipoCursoTecnico = JSON.parse(categoryIdTipoCursoResponse).categoryId; 
2455        categoryIdTipoCurso = idTipoCursoTecnico; 
2456			}catch(err){ 
2457				console.error('idTipoCursoTecnico nao obtido ' + err.message); 
2458
2459			// verificaAcessoDiretoELoadTema(); 
2460		}); 
2461		 
2462	}); 
2463		 
2464
2465 
2466function verificaFiltroInscricaoBolsaEToggle() { 
2467  const urlParams = new URLSearchParams(window.location.search) 
2468  $('#chkInscricao').prop("checked", urlParams.get('inscricao') == 'true') 
2469  $('#chkInscricao').prop("checked") ? filtrarInscricoesAbertas = 1 : filtrarInscricoesAbertas = 0 
2470  $('#chkInscricao').change(ev => selectFilter('inscricao', $('#chkInscricao')) ) 
2471   
2472  if($('#chkBolsa').length) { 
2473    $('#chkBolsa').prop("checked", urlParams.get('bolsa') == 'true') 
2474    $('#chkBolsa').prop("checked") ? filtrarBolsaEstudo = 1 : filtrarBolsaEstudo = 0 
2475    $('#chkBolsa').change(ev => selectFilter('bolsa', $('#chkBolsa')) )     
2476
2477
2478 
2479function carregarCategorias() { 
2480	if(!categorias.length) { 
2481		const searchParams = new URLSearchParams({ 
2482			companyId: themeDisplay.getCompanyId(), 
2483			groupIds: themeDisplay.getScopeGroupId(), 
2484			parentCategoryIds: 0, 
2485			vocabularyIds: document.querySelector('#ssp-vocabulary-id-tema-mercadologico').value 
2486		}) 
2487 
2488		$.ajax({ 
2489			url : '/o/senac-category-services/categories?' + searchParams.toString(), 
2490			method : 'get', 
2491			async: false 
2492		}) 
2493		.done(data => categorias = data) 
2494		.fail(err => console.error(err)) 
2495
2496
2497 
2498function selectFilter(paramkey, el) { 
2499  setUrlParam(paramkey, el.prop("checked"))   
2500
2501 
2502function setUrlParam(key, value) { 
2503  const url = new URL(window.location.href) 
2504  if(value) 
2505   	url.searchParams.set(key, value); 
2506  else 
2507	url.searchParams.set(key, false) 
2508  window.history.pushState({}, '', decodeURIComponent(url.toString())) 
2509
2510	 
2511$(document).on("click", '.ssp-btn__visualizar-mais-content', toggleVisualizarMais) 
2512 
2513function visualizarMenos() { 
2514  const itensTema = $('#temas').children(); 
2515  const itensExibidos = 6; 
2516 
2517  if(isMobile) 
2518    itensTema.slice(itensExibidos).hide(); 
2519 
2520  $('#visualizar-mais').text('Visualizar mais'); 
2521  $('#visualizar-mais').parent().find('i').removeClass('fa-chevron-up'); 
2522  $('#visualizar-mais').parent().find('i').addClass('fa-chevron-down'); 
2523
2524 
2525function visualizarMais() { 
2526  const itensTema = $('#temas').children(); 
2527  const itensExibidos = 6; 
2528 
2529  if(isMobile) 
2530    itensTema.slice(itensExibidos).show(); 
2531     
2532  $('#visualizar-mais').text('Visualizar menos'); 
2533  $('#visualizar-mais').parent().find('i').removeClass('fa-chevron-down'); 
2534  $('#visualizar-mais').parent().find('i').addClass('fa-chevron-up'); 
2535
2536 
2537function toggleVisualizarMais(){   
2538  if( $('#visualizar-mais').text() === "Visualizar mais" ) 
2539    visualizarMais()					 
2540  else 
2541    visualizarMenos()   
2542
2543 
2544function showVisualizarMais() { 
2545  const itensTema = $('#temas').children(); 
2546  const itensExibidos = 6; 
2547 
2548  if($('#temas').children().length <= itensExibidos) 
2549    hideVisualizarMais() 
2550  else 
2551    $('.ssp-btn__visualizar-mais-content').show() 
2552
2553 
2554function hideVisualizarMais() { 
2555  $('.ssp-btn__visualizar-mais-content').hide() 
2556
2557 
2558/* Carrega os subtemas ou cursos ao clicar no tema */ 
2559let lastClicked 
2560$(".container").on( 
2561		"click", 
2562		".tema", 
2563		function() { 
2564      const categoriaId = $(this).data('tema'); 
2565      const isEqualTema = lastClicked == categoriaId 
2566      lastClicked = categoriaId 
2567 
2568      const isTodos = this.classList.contains('todos') 
2569       
2570      activeCategoryLevel = $(this).data('nvl'); 
2571      limit = 2; 
2572			offset = 0;			 
2573			limitTodosCursos = 16; 
2574			offsetTodosCursos = 0; 
2575 
2576      $('#filtro-temas-nivel-2').empty() 
2577			$('#filtro-temas-nivel-3').empty() 
2578 
2579      hideVisualizarMais() 
2580      $('.tema').removeClass('ativo'); 
2581      $('.tema').removeClass('tema-ativo') 
2582      $('.ssp-section-tema__container-menu-item').show() 
2583 
2584      document.querySelector('.ssp-divider').classList.add('d-none') 
2585 
2586      document.querySelector('[data-section="title"]').classList.remove('selected') 
2587 
2588      if(isTodos){ 
2589        document.querySelector('[data-section="title"]').innerHTML = 'Qual a sua área de interesse?' 
2590        document.querySelector('.ssp-divider').classList.remove('d-none') 
2591 
2592        showVisualizarMais() 
2593				atualizaUrlBrowser(0,0); 
2594				$('.todos').addClass('ativo'); 
2595 
2596        if(isMobile) { 
2597          visualizarMenos() 
2598          showVisualizarMais() 
2599
2600      } else { 
2601        document.querySelector('[data-section="title"]').innerHTML = 'Você selecionou:' 
2602        $('.ssp-section-tema__container-menu-item').hide() 
2603        $('.ssp-section-tema__container-menu-item').has(this).show() 
2604 
2605        if(isEqualTema) { 
2606          removeFiltersLevel1() 
2607          return 
2608        } else 
2609          $(this).addClass('tema-ativo') 
2610 
2611        $.ajax( 
2612
2613							url : '/o/senac-content-services/category/' 
2614									+ $(this).data('tema'), 
2615							type : 'get' 
2616						}).done(function(category) { 
2617	 
2618					activeCategory = JSON.parse(category); 
2619					 
2620					cleanElements(); 
2621 
2622					displayCursosPorTema(); 
2623					 
2624					displaySubTemasLista(); 
2625 
2626          buscaFriendlyUrlTemaEAtualizaBrowser(categoriaId,1); 
2627				}); 
2628				         
2629        if(!this.classList.contains('todos')) { 
2630					hideOthersLevel1(this) 
2631
2632
2633
2634); 
2635 
2636/* Quando clica em Ver Todos cursos de um tema */ 
2637function verTodosCursos(){ 
2638	 
2639	//Scrool top 
2640	$('html, body').animate({ 
2641        scrollTop: $("#temas").offset().top 
2642    }, -1000); 
2643	 
2644	 
2645	var tema = $(this).data('tema'); 
2646	activeCategoryLevel = $(this).data('nvl'); 
2647	 
2648	if(activeCategoryLevel == 1) 
2649		buscaFriendlyUrlTemaEAtualizaBrowser(tema,activeCategoryLevel); 
2650 
2651	// Verifica o elemento, adiciona a classe ativo e remove dos seus primos 
2652	$('.todos').removeClass('ativo'); 
2653	 
2654	limit = 2; 
2655	offset = 0; 
2656 
2657	$.ajax({ 
2658		url : '/o/senac-content-services/category/'+ tema, 
2659		type : 'get' 
2660	}).done(function(category) { 
2661 
2662		activeCategory = JSON.parse(category); 
2663		 
2664		switch(activeCategoryLevel){ 
2665			case 1: 
2666				$('.tema').removeClass('tema-ativo'); 
2667				$('.tema[data-tema="'+activeCategory.categoryId+'"]').not('.slick-cloned').each(function(){ 
2668					if(!$(this).parent().hasClass('slick-cloned')){	 
2669						var botaoTemaVerTodos = $(this); 
2670						botaoTemaVerTodos.trigger('click'); 
2671
2672				}); 
2673				 
2674				break; 
2675			case 2: 
2676					 
2677				var botaoTemaVerTodosNv2 = $('.subtema[data-tema="'+activeCategory.categoryId+'"]'); 
2678				botaoTemaVerTodosNv2.trigger('click'); 
2679				 
2680				break; 
2681			case 3: 
2682				var botaoTemaVerTodosNv3 = $('.subtema[data-tema="'+activeCategory.categoryId+'"]'); 
2683				botaoTemaVerTodosNv3.trigger('click'); 
2684				 
2685				break; 
2686
2687			 
2688		 
2689	}); 
2690
2691	 
2692function defaultSubtema(el, temaIds) {   
2693  limit = 2; 
2694  offset = 0; 
2695  limitTodosCursos = 16; 
2696  offsetTodosCursos = 0; 
2697   
2698  $('#cursos-por-subtema-container').find('#curso-sem-slick').empty(); 
2699 
2700  activeCategoryLevel = $(el).data('nvl'); 
2701 
2702  if(!acessoDireto) 
2703    buscaFriendlyUrlTemaEAtualizaBrowser($(el).data('tema'),activeCategoryLevel); 
2704     
2705  cleanElements(); 
2706     
2707  const categories = [] 
2708  temaIds.forEach(id => { 
2709    $.ajax({ 
2710      url : '/o/senac-content-services/category/' + id, 
2711      type : 'get', 
2712      async: false 
2713    }) 
2714    .done((category) => { 
2715      activeCategory = JSON.parse(category) 
2716      categories.push(activeCategory) 
2717    }) 
2718  }); 
2719 
2720  displayCursosPorTema(categories) 
2721
2722 
2723// evento de click nos subtemas 
2724$("#filtro-temas-nivel-2") 
2725.on("click", ".subtema", function(ev, trigger) { 
2726   
2727  $(this).siblings('.todos').removeClass("subtema-ativo") 
2728 
2729  if(this.classList.contains('todos') || (this.classList.contains('subtema-ativo') && !trigger)) { 
2730    removeFiltersLevel2() 
2731    return 
2732  } else { 
2733    hideOthersLevel2(this) 
2734    this.classList.add('subtema-ativo') 
2735
2736 
2737  defaultSubtema(this, [$(this).data('tema')]) 
2738}) 
2739 
2740$("#filtro-temas-nivel-3") 
2741.on("click", ".subtema", function(ev) {   
2742   
2743  $(this).siblings('.todos').removeClass("subtema-ativo") 
2744 
2745  if(this.classList.contains('todos')) { 
2746    removeFiltersLevel3() 
2747    return 
2748
2749   
2750  const isActived = this.classList.contains('subtema-ativo') 
2751  if(isActived) 
2752    this.classList.remove('subtema-ativo') 
2753  else 
2754    this.classList.add('subtema-ativo') 
2755   
2756 
2757  const anyActive = !!document.querySelector("#filtro-temas-nivel-3 a.subtema-ativo") 
2758  if(!anyActive) 
2759    removeFiltersLevel3() 
2760 
2761  const temaIds = [] 
2762  document.querySelectorAll("#filtro-temas-nivel-3 a.subtema-ativo:not(.todos)") 
2763  .forEach(a => temaIds.push(a.getAttribute('data-tema'))) 
2764 
2765  defaultSubtema(this, temaIds) 
2766}) 
2767 
2768/* Click no botao todos */ 
2769$(".container").on("click", ".todos:not(.subtema.todos)", function() { 
2770	 
2771	atualizaUrlBrowser(0); 
2772	 
2773	activeCategory = 'all'; 
2774	activeCategoryLevel = $(this).data('nvl'); 
2775	offset = 0; 
2776 
2777	/* Limpa dados de subtemas que possam ter sido criados na navegação */ 
2778	cleanElements(); 
2779 
2780  $('#tema-atual').show() 
2781	$('#tema-atual h2').text(todosText); 
2782	 
2783	// Esconde a div com subtemas 
2784	$('#filtro-temas-nivel-2').empty(); 
2785	$('#filtro-temas-nivel-2').addClass('d-none'); 
2786 
2787	displayCursosPorTema(); 
2788 
2789}); 
2790 
2791/* Limpa a tela para exibição de novos cursos */ 
2792function cleanElements() { 
2793 
2794	$('#subtemas-lista').empty(); 
2795		 
2796	$('#cursos-por-categoria-container .cursos-por-categoria').remove(); 
2797	$('#subtema-atual').empty(); 
2798	$('#cursos-por-subtema-container #subsubtemas-lista').empty(); 
2799	$('#cursos-por-subtema-container .ssp-card-curso').remove(); 
2800	 
2801	$('#cursos-por-categoria-container').removeClass('d-none'); 
2802	$('#cursos-por-subtema-container').addClass('d-none'); 
2803
2804 
2805/* 
2806 * Armazena a navegação em cookies, se habilitado 
2807 */ 
2808$(document).on("click", ".ck-curso", function() { 
2809	 
2810	//Verifica se os alternadores estao selecionados e manipula o link do curso de acordo a eles. 
2811	urlFinal = new URL(window.location.origin + $(this).attr('href')); 
2812	let filtroInscricaoBolsa = false; 
2813	 
2814    if($("#inscricao-aberta input").is(":checked")){ 
2815      urlFinal.searchParams.set("inscricao", true); 
2816      filtroInscricaoBolsa = true; 
2817    }  
2818    if($("#bolsas-estudo input").is(":checked")){ 
2819      urlFinal.searchParams.set("bolsa", true); 
2820      filtroInscricaoBolsa = true; 
2821    }  
2822    $(this).attr('href', urlFinal.pathname + (filtroInscricaoBolsa ? "?"+urlFinal.searchParams : "")) 
2823	 
2824 
2825	//Verifica se o cookie está habilitado 
2826    if(getCookie('portalSenacCookie') != null){ 
2827    	 
2828		var articleId = $(this).data('ck'); 
2829		manageCookieArray(cookieName, articleId); 
2830		manageCookieArray('ck-cursos', articleId); 
2831
2832 
2833}); 
2834 
2835/* 
2836 * Exibe os cursos por tema, dependendo do nivel 
2837 */ 
2838function displayCursosPorTema(categories) {   
2839	hideMensagemSemCurso(); 
2840 
2841	// Verifica o nivel 
2842	switch (activeCategoryLevel) { 
2843 
2844	case 0: // exibe todos 
2845    $('#tema-atual').hide() 
2846		limit = 2; 
2847 
2848		$.each(temas.slice(offset, limit + offset), function(k, t) { 
2849			 
2850			if($('#cursos-por-categoria-'+t.categoryId).length == 0){ 
2851				var template = $('#cursos-por-categoria-template').clone(); 
2852				template.prop('id', 'cursos-por-categoria-'+t.categoryId); 
2853				template.removeClass('d-none'); 
2854				$('#cursos-por-categoria-container').append(template); 
2855
2856			 
2857			$.ajax( 
2858
2859						url : '/o/senac-content-services/category/' 
2860								+ t.categoryId, 
2861						type : 'get', 
2862            async: false 
2863					}).done(function(category) { 
2864						 
2865						var dadosCategoria = JSON.parse(category); 
2866						 
2867						//monta as divs para cada tcategoria 
2868						var templatePorCategoria = $('#cursos-por-categoria-'+dadosCategoria.categoryId); 
2869						templatePorCategoria.find('.tema-nome').text(dadosCategoria.name); 
2870						templatePorCategoria.find('.ver-todos-cursos-link').attr('data-nvl', 1); 
2871						templatePorCategoria.find('.ver-todos-cursos-link').attr('data-tema', dadosCategoria.categoryId); 
2872						templatePorCategoria.removeClass('d-none'); 
2873 
2874						cursosPorCategoriaModelo1(dadosCategoria); 
2875 
2876			}); 
2877		}); 
2878		 
2879		// Esconde botao carregar mais, se  necessário 
2880		 
2881		$('.section-carregar-mais').remove(); 
2882		 
2883		if (temas.length > limit + offset) 
2884			$('#cursos-por-categoria-container').append('<section style="padding: 30px 0; width:100%" class="section-carregar-mais"><div class="container"><a href="#a" class="ssp-section-tema__btn-ver-mais" id="carregar-mais" style="visibility:hidden"> Carregar mais unidades </a></div></section>'); 
2885			 
2886		break; 
2887 
2888	case 1: 
2889		limit = 2; 
2890 
2891		$('#tema-atual h2').text("O que você quer aprender nessa área?"); 
2892    $('#tema-atual').show() 
2893		 
2894		// Exibe os cursos dos subtemas do tema clicado percorrendo a lista de 
2895		// subtemas do tema clicado 
2896		if(subtemasStorage.get(activeCategory.categoryId) && subtemasStorage.get(activeCategory.categoryId).length > 0){ 
2897			 
2898			$.each(subtemasStorage.get(activeCategory.categoryId).slice(offset, 
2899					limit + offset), function(k, t) { 
2900				 
2901				if($('#cursos-por-categoria-'+t.categoryId).length == 0){ 
2902					var template = $('#cursos-por-categoria-template').clone(); 
2903					template.prop('id', 'cursos-por-categoria-'+t.categoryId); 
2904	 
2905					template.removeClass('d-none'); 
2906					 
2907					$('#cursos-por-categoria-container').append(template); 
2908
2909				 
2910				$.ajax( 
2911
2912							url : '/o/senac-content-services/category/' 
2913									+ t.categoryId, 
2914							type : 'get', 
2915            async: false 
2916						}).done(function(category) { 
2917							 
2918							var dadosCategoria = JSON.parse(category); 
2919							 
2920							//monta as divs para cada tcategoria 
2921							var templatePorCategoria = $('#cursos-por-categoria-'+dadosCategoria.categoryId); 
2922							templatePorCategoria.find('.tema-nome').text(dadosCategoria.name); 
2923							templatePorCategoria.find('.ver-todos-cursos-link').attr('data-nvl', 2); 
2924							templatePorCategoria.find('.ver-todos-cursos-link').attr('data-tema', dadosCategoria.categoryId); 
2925							templatePorCategoria.removeClass('d-none'); 
2926 
2927							cursosPorCategoriaModelo1(dadosCategoria); 
2928	 
2929				}); 
2930			}); 
2931			 
2932			// Esconde botao carregar mais, se  necessário 
2933			$('.section-carregar-mais').remove(); 
2934			 
2935			if (subtemasStorage.get(activeCategory.categoryId).length > limit + offset) 
2936				$('#cursos-por-categoria-container').append('<section style="padding: 30px 0; width:100%" class="section-carregar-mais"><div class="container"><a href="#a" class="ssp-section-tema__btn-ver-mais" id="carregar-mais" style="visibility:hidden"> Carregar mais unidades </a></div></section>'); 
2937			 
2938		}else{ 
2939			//Se nao tiver subtema, exibe o modelo 2 
2940			cursosPorCategoriaModelo2(); 
2941
2942 
2943		break; 
2944 
2945	case 2: // exibe cursos do nivel 2 
2946		limitTodosCursos = 16; 
2947		cursosPorCategoriaModelo2(); 
2948		break; 
2949		 
2950	case 3: 
2951    // subtemas de nivel 3 nao devem ter limite 
2952    limitTodosCursos = ($('#filtro-temas-nivel-3 .subtema-ativo:not(.todos)').length) ? -1 : 16; 
2953		cursosPorCategoriaModelo3(categories); 
2954		break; 
2955
2956   
2957
2958 
2959/* 
2960 * Faz a exibição dos cursos quando se carrega a tela ou clica em 'Todos' 
2961 */ 
2962function cursosPorCategoriaModelo1(category) { 
2963 
2964	activeModeloExibicao = 1; 
2965  categoryWithoutCourse = [] 
2966  hideMensagemSemCurso() 
2967 
2968	var urlFinal = urlCursosPorTipoCursoETemaComFiltrosBolsaECompra 
2969		.replace('{groupId}', groupId) 
2970		.replace('{unidadeCategoryId}', unidadeCategoryId) 
2971		.replace('{categoryTemaId}', category.categoryId) 
2972		.replace('{categoriaId}', idModalidadeEspecTecnica) 
2973		.replace('{filtrarInscricoesAbertas}', filtrarInscricoesAbertas) 
2974		.replace('{filtrarBolsaEstudo}', filtrarBolsaEstudo) 
2975		.replace('{considerarUnidade}', 1) 
2976		.replace('{start}', 0) 
2977		.replace('{end}', limitCursos); 
2978 
2979 
2980 
2981 
2982
2983			.ajax( 
2984
2985						url : urlFinal, 
2986						type : 'get', 
2987						beforeSend: function () { 
2988							loading('#cursos-por-categoria-'+category.categoryId+' .slider-curso'); 
2989
2990					}) 
2991			.done( 
2992					function(cursosPorCategoria) { 
2993 
2994						enableScroll(true); 
2995 
2996						cursosPorCategoria = JSON.parse(cursosPorCategoria); 
2997						 
2998						var totalCursos = cursosPorCategoria.total; 
2999						 
3000						//Se nao retornou cursos, deve esconder a div da categoria 
3001						if(totalCursos == 0){ 
3002							$('#cursos-por-categoria-'+category.categoryId).html(''); 
3003							 
3004							//essa classe tirar todo o padding da div, escondendo ela 
3005							$('#cursos-por-categoria-'+category.categoryId).removeClass('ssp-section'); 
3006							 
3007							if(isMobile){ 
3008								var $element = document.getElementById('cursos-por-categoria-container'); 
3009								var _elementPos = $element.offsetTop + 100; 
3010								var _scrollDown = _elementPos + (filtrarInscricoesAbertas == 1 || filtrarBolsaEstudo == 1 ? 300 : 1); 
3011								window.scrollTo(window.scrollX || window.pageXOffset, _scrollDown);//carrega os cursos 
3012								setTimeout(()=> window.scrollTo(window.scrollX || window.pageXOffset, _elementPos), 500);//mostra o primeiro 
3013								 
3014							}else{ 
3015								var _scrollDown = (window.scrollY || window.pageYOffset) + (filtrarInscricoesAbertas == 1 || filtrarBolsaEstudo == 1 ? 20 : 1); 
3016								window.scrollTo(window.scrollX || window.pageXOffset, _scrollDown); 
3017
3018            				updateMensagemSemCurso(); 
3019				      		return; 
3020						}else{ 
3021						 
3022							if(!$('#cursos-por-categoria-'+category.categoryId).hasClass('ssp-section')) 
3023								$('#cursos-por-categoria-'+category.categoryId).addClass('ssp-section'); 
3024								 
3025
3026						 
3027						var articles = []; 
3028			      		 
3029			      		 $.each(cursosPorCategoria.cursos, function(k, c){ 
3030			      			articles.push(c.articleId); 
3031			      		 }); 
3032			      		  
3033						    
3034			      		//Verifica a situação dos botoes de inscrições e bolsa 
3035						  $.ajax({ 
3036						        url :  '/o/senac-content-services/verificaBotoesInscricaoEBolsaPorUnidade/'+groupId+'/'+articles.join(',')+'/'+unidadeCategoryId, 
3037						        type : 'get', 
3038                    async: false 
3039						    })  
3040						    .done(function(infoBotoes){ 
3041						    	 
3042						    	enableScroll(true); 
3043						    	 
3044						    	if(infoBotoes.length > 0) { 
3045						    		 
3046									infoBotoes = JSON.parse(infoBotoes); 
3047 
3048									var template = $('#cursos-por-categoria-'+category.categoryId); 
3049									 
3050									$('#cursos-por-categoria-'+category.categoryId+' .slider-curso').empty(); 
3051 
3052									$.each(cursosPorCategoria.cursos, async function(k, curso) { 
3053										 
3054										var itemCurso = buildCardCurso(curso, infoBotoes, isMobile) 
3055										 
3056										template.append(itemCurso); 
3057			 
3058										template.find('.slider-curso').append(itemCurso); 
3059			 
3060									}); 
3061 
3062									updateMensagemSemCurso(); 
3063			 
3064									// chama o slider por categoria 
3065									if (isMobile){ 
3066										template.find('.slider-curso').css({"flex-wrap":"wrap"}); 
3067										 
3068										if($('.ssp-page-busca__section-resultado__ver-todos-mobile[data-tema="'+category.categoryId+'"]').length == 0){ 
3069											 
3070											//Exibe o link ver todos 
3071											//Adicionava o botão ver todos. Possível adição do código do card novo! 
3072											if(totalCursos > 4){ 
3073											template.find('.slider-curso').append('<a data-nvl="'+(activeCategoryLevel+1)+'" data-tema="'+category.categoryId+'" class="ssp-card-todos-cursos especializacao-tecnica card-ver-todos-cursos-link" ><p>Conferir todos <br>os <span>cursos</span></p><i class="far fa-arrow-right"></i></a>') 
3074											} else { 
3075											$(".ver-todos-cursos-link[data-tema='"+category.categoryId+"']").addClass("ver-todos-no-click"); 
3076											}	 
3077
3078									}else{ 
3079										template.find('.slider-curso').addClass( 
3080											'slick-area slick-area--md-bleed slider-container slider-id-' 
3081													+ category.categoryId); 
3082										if(totalCursos > 11){ 
3083											template.find('.slider-curso').append('<a data-nvl="'+(activeCategoryLevel+1)+'" data-tema="'+category.categoryId+'" class="ssp-card-todos-cursos especializacao-tecnica card-ver-todos-cursos-link" ><p>Conferir todos <br>os <span>cursos</span></p><i class="far fa-arrow-right"></i></a>')			 
3084										} else { 
3085											$(".ver-todos-cursos-link[data-tema='"+category.categoryId+"']").addClass("ver-todos-no-click"); 
3086
3087 
3088										$('.slider-id-' + category.categoryId).removeClass('slick-initialized') 
3089										sliderCurso('.slider-id-' + category.categoryId); 
3090
3091						    	}  
3092						    }) 
3093					}) 
3094 
3095			.fail(function(jqXHR, textStatus, msg) { 
3096				// alert(msg); 
3097			}) 
3098
3099 
3100/* 
3101 * Faz a exibição dos cursos quando se clica em temas nivel 2 
3102 */ 
3103function cursosPorCategoriaModelo2() { 
3104	 
3105	activeModeloExibicao = 2; 
3106  categoryWithoutCourse = [] 
3107  hideMensagemSemCurso() 
3108 
3109  $('#tema-atual').hide() 
3110	$("#tema-atual h2").html(''); 
3111	 
3112  var url = urlSearchTemas 
3113		.replace('{groupId}', groupId) 
3114		.replace('{unidadeCategoryId}', unidadeCategoryId) 
3115		.replace('{categoriaId}', idModalidadeEspecTecnica) 
3116		.replace('{nivelTema}', 2) 
3117		.replace('{categoriaParentId}', activeCategory.categoryId); 
3118     
3119	// Busca os filhos (3 nivel) 
3120	$.ajax({ 
3121		url : url, 
3122		type : 'get', 
3123		data : {} 
3124		}).done(function(subtemas) { 
3125			 
3126			enableScroll(true); 
3127 
3128			subtemas = JSON.parse(subtemas); 
3129			 
3130      let subsubtemaLista = '' ;  
3131       
3132			if(subtemas.length > 0) { 
3133				subsubtemaLista = '<h3 class="ssp-title-filtrar-mais">Filtrar mais:</h3>'; 
3134        const btnTodos = '<a href="#a" '  
3135        + ' class="subtema btn-nivel-3 subtema-ativo todos" ' 
3136				+ '" data-nvl="2" >' 
3137				+ 'Todos' 
3138				+ '</a>' 
3139       
3140        subsubtemaLista += btnTodos 
3141
3142 
3143			$.each(subtemas, function(k, v) { 
3144				subsubtemaLista += '<a href="#a" class="subtema btn-nivel-3" data-tema="' 
3145						+ v.categoryId 
3146						+ '" data-nvl="3" >' 
3147						+ v.name 
3148						+ '</a>'; 
3149			}); 
3150 
3151      const containerSubTemaLista = document.createElement('div') 
3152      containerSubTemaLista.classList.add('row') 
3153      containerSubTemaLista.innerHTML = subsubtemaLista 
3154			$('#filtro-temas-nivel-3').html(containerSubTemaLista.outerHTML); 
3155			 
3156			if(subtemas.length > 0) $('#filtro-temas-nivel-3').removeClass('d-none'); 
3157			 
3158      cursosPorCategoriaModelo3(); 
3159				 
3160	}) 
3161	 
3162
3163 
3164async function getCursosByCategory(category) { 
3165  if(activeCategory == 'all') 
3166    return [] 
3167 
3168  var urlFinal = urlCursosPorTipoCursoETemaComFiltrosBolsaECompra 
3169		.replace('{groupId}', groupId) 
3170		.replace('{unidadeCategoryId}', unidadeCategoryId) 
3171		.replace('{categoryTemaId}', category.categoryId) 
3172		.replace('{categoriaId}', idModalidadeEspecTecnica) 
3173		.replace('{filtrarInscricoesAbertas}', filtrarInscricoesAbertas) 
3174		.replace('{filtrarBolsaEstudo}', filtrarBolsaEstudo) 
3175		.replace('{considerarUnidade}', 1) 
3176		.replace('{start}', offsetTodosCursos) 
3177		.replace('{end}', (limitTodosCursos + offsetTodosCursos)); 
3178 
3179 
3180    return new Promise((resolve) => { 
3181      $.ajax({ 
3182        url : urlFinal, 
3183        type : 'get', 
3184        data : {}, 
3185        async: false, 
3186        beforeSend: function () { 
3187          var totalItens = $('#curso-sem-slick .slick-area__item').length; 
3188          if(totalItens > 0){ 
3189            $('#curso-sem-slick .slick-area__item').each(function(){ 
3190              if(!$.trim($(this).html()).length) 
3191                $(this).remove(); 
3192            }) 
3193
3194
3195      }) 
3196      .done((data) => resolve(JSON.parse(data))) 
3197    }) 
3198
3199/* 
3200 * Faz a exibição dos cursos quando se clica em temas nivel 3 
3201 */ 
3202async function cursosPorCategoriaModelo3(categories) {   
3203	activeModeloExibicao = 3; 
3204  categoryWithoutCourse = [] 
3205  hideMensagemSemCurso() 
3206 
3207	//Se já estiver carregando não deixa juntar várias chamadas 
3208	if($('#loading-todos-cursos').length > 0) return; 
3209	 
3210	//Loading 
3211	$('#cursos-por-categoria-container').append('<div id="loading-todos-cursos" style="width:100%; text-align:center">'+ 
3212	'<div class="ssp-loader-content">'+ 
3213	'<div class="ssp-loader"></div>'+ 
3214	'<p class="ssp-loader-text">Carregando...</p>'+ 
3215	'</div>'+ 
3216	'</div>'); 
3217  $("#tema-atual").hide() 
3218	$("#tema-atual h2").html(''); 
3219	 
3220    categories = categories && categories.length ? categories : [activeCategory] 
3221   
3222  const cursosPorSubtema = [] 
3223  var totalCursos = 0; 
3224  var templateContainer = $('#cursos-por-subtema-container'); 
3225  if(offsetTodosCursos == 0) templateContainer.find('#curso-sem-slick').empty(); 
3226 
3227  for (let index = 0; index < categories.length; index++) { 
3228    const category = categories[index]; 
3229     
3230    const cursosEncontrados = await getCursosByCategory(category) 
3231     
3232    if(!cursosEncontrados || !cursosEncontrados.cursos || !cursosEncontrados.length) 
3233      categoryWithoutCourse.push(category) 
3234 
3235    totalCursos += cursosEncontrados.total; 
3236 
3237    cursosEncontrados.cursos.forEach(cEncontrado => { 
3238      if(!cursosPorSubtema.filter(c => c.articleId == cEncontrado.articleId).length) 
3239        cursosPorSubtema.push(cEncontrado) 
3240    })     
3241
3242               
3243  $('.ssp-loader-content').parent().remove(); 
3244   
3245  if(!cursosPorSubtema.length) { 
3246	updateMensagemSemCurso() 
3247    enableScroll(true) 
3248    return 
3249
3250 
3251  var articles = []; 
3252         
3253  $.each(cursosPorSubtema, function(k, c){ 
3254		articles.push(c.articleId); 
3255  }); 
3256   
3257  //Verifica a situação dos botoes de inscrições e bolsa 
3258  $.ajax({ 
3259    url :  '/o/senac-content-services/verificaBotoesInscricaoEBolsaPorUnidade/'+groupId+'/'+articles.join(',')+'/'+unidadeCategoryId, 
3260    type : 'get', 
3261    async: false 
3262  })  
3263  .done(async function(infoBotoes){ 
3264           
3265    if(infoBotoes.length > 0) { 
3266       
3267      infoBotoes = JSON.parse(infoBotoes); 
3268 
3269      for (let index = 0; index < cursosPorSubtema.length; index++) { 
3270        const curso = cursosPorSubtema[index]; 
3271         
3272        var itemCurso = buildCardCurso(curso, infoBotoes, isMobile) 
3273         
3274        itemCurso.addClass('card-curso-nivel-2'); 
3275 
3276        // procura a div criada e adiciona os cursos 
3277        templateContainer.find('#curso-sem-slick').append(itemCurso); 
3278
3279       
3280      templateContainer.removeClass('d-none'); 
3281         
3282      var totalCursosExibicao = $('#curso-sem-slick .slick-area__item').length; 
3283       
3284      // Esconde botao carregar mais, se  necessário 
3285      $('.section-carregar-mais').remove(); 
3286       
3287      if (totalCursosExibicao < totalCursos)  
3288        $('#cursos-por-subtema-container').append('<section style="padding: 30px 0; width:100%" class="section-carregar-mais"><div class="container"><a href="#a" class="ssp-section-tema__btn-ver-mais" id="carregar-mais" style="visibility:hidden"> Carregar mais unidades </a></div></section>'); 
3289
3290 
3291    updateMensagemSemCurso(); 
3292 
3293  }) 
3294 
3295  enableScroll(true) 
3296
3297 
3298function montaTextoTipoCursoParaCard(curso){ 
3299	 
3300	var tipoCursoNomeFinal = curso.tipoCursoNome + " ¿ " + curso.formatos[0].name;	                 			  
3301 
3302	if(curso.tipoCursoNome == "Livre") 
3303		tipoCursoNomeFinal = "Livre"; 
3304		//tipoCursoNomeFinal = "Curso " + curso.tipoCursoNome + " ¿ " + curso.formatos[0].name; 
3305	 
3306	return tipoCursoNomeFinal; 
3307
3308 
3309//ao final de todos os ajax, se não houver curso na pag por causa dos filtros, exibimos mensagem de nenhum curso 
3310$(document).ajaxStop(function () { 
3311  $(".card-curso-nivel-2").each(function () { 
3312    if($(this).children().length == 0) 
3313      $(this).remove() 
3314  }); 
3315});	 
3316 
3317function hideMensagemSemCurso() { 
3318	const $msg = $("#filtroSemCurso"); 
3319	if(!$msg.hasClass('d-none')) $msg.addClass('d-none'); 
3320
3321function updateMensagemSemCurso() { 
3322	 
3323	if($(".slick-area__item").not('.cursos-recentes-card').not('.d-none').length > 0 || $('#curso-sem-slick .slick-area__item').length > 0){ 
3324		hideMensagemSemCurso(); 
3325		return; 
3326
3327 
3328	let htmlSemCurso = '' 
3329	 
3330	switch (getCurrentLevel()) { 
3331	case 1: 
3332	case 2: 
3333		htmlSemCurso = getTextoSemCurso(filtrarBolsaEstudo,filtrarInscricoesAbertas,activeCategory.name) 
3334		$(".ssp-bolsa-formulario__card-aviso-texto").html(htmlSemCurso); 
3335		break; 
3336 
3337	case 3: 
3338		categoryWithoutCourse 
3339		.forEach(category => { 
3340		const el = document.querySelector('[data-tema="' + category.categoryId + '"]') 
3341		if(el) { 
3342			const temaName = el.text 
3343			htmlSemCurso += getTextoSemCurso(filtrarBolsaEstudo, filtrarInscricoesAbertas, temaName) 
3344
3345		}) 
3346		if(!htmlSemCurso) 
3347		htmlSemCurso = getTextoSemCurso(filtrarBolsaEstudo,filtrarInscricoesAbertas,activeCategory.name) 
3348 
3349		$(".ssp-bolsa-formulario__card-aviso-texto").html(htmlSemCurso); 
3350		break; 
3351 
3352	default: 
3353		break; 
3354
3355	 
3356	if(htmlSemCurso){ 
3357		$("#filtroSemCurso").removeClass("d-none"); 
3358
3359
3360 
3361function getTextoSemCurso(filtroBolsa,filtroInsc,temaNome){ 
3362	 
3363	temaNome = typeof temaNome === "undefined" ? '' : 'de '+temaNome; 
3364	 
3365	if(filtroBolsa && filtroInsc) 
3366		return "<p>No momento, estamos sem cursos <strong><span id='nomeTemaSemCurso'>"+temaNome+"</span></strong> disponíveis para compra e com bolsas de estudo.<br>Selecione outras áreas para consultar bolsas ou <a href='https://www.sp.senac.br/bolsas-de-estudo'>confira bolsas disponíveis em diferentes cursos.</a></p>"; 
3367	else if(filtroBolsa) 
3368		return "<p>No momento, estamos sem cursos <strong><span id='nomeTemaSemCurso'>"+temaNome+"</span></strong> com bolsas de estudo.<br>Selecione outras áreas para consultar bolsas ou <a href='https://www.sp.senac.br/bolsas-de-estudo'>confira bolsas disponíveis em diferentes cursos.</a></p>";	 
3369	else if(filtroInsc) 
3370		return "<p>No momento, estamos sem cursos <strong><span id='nomeTemaSemCurso'>"+temaNome+"</span></strong> disponíveis para compra."; 
3371 
3372  return '' 
3373
3374 
3375/* 
3376 * Monta a lista de temas de curso livre no header da página 
3377 */ 
3378 
3379function carregaTemas() { 
3380 
3381  const url = urlSearchTemas 
3382		.replace('{groupId}', groupId) 
3383		.replace('{unidadeCategoryId}', unidadeCategoryId) 
3384		.replace('{categoriaId}', idModalidadeEspecTecnica) 
3385		.replace('{nivelTema}', 0) 
3386		.replace('{categoriaParentId}', 0); 
3387 
3388
3389			.ajax( 
3390
3391						url : url, 
3392						type : 'get', 
3393            async: false 
3394					}) 
3395			.done( 
3396					function(temasLista) { 
3397						if(typeof temasLista != 'object') 
3398							temasLista = JSON.parse(temasLista); 
3399 
3400						var temasObj = $('#temas'); 
3401 
3402
3403								.each( 
3404										temasLista, 
3405										function(k, tema) { 
3406											const icon = (categorias.filter(cat => cat.categoryId == tema.categoryId)[0] || {properties: {}}).properties.icon 
3407											temasObj 
3408													.append('<div class="ssp-section-tema__container-menu-item mega-menu"><a href="#a" class="tema" data-nvl="1" data-tema="' 
3409															+ tema.categoryId 
3410															+ '">' 
3411															+ '<i class="' + icon + '"></i>' 
3412															+ tema.name 
3413															+ '</a></div>'); 
3414 
3415                      const urlSubTema = urlSearchTemas 
3416                        .replace('{groupId}', groupId) 
3417                        .replace('{unidadeCategoryId}', unidadeCategoryId) 
3418                        .replace('{categoriaId}', idModalidadeEspecTecnica) 
3419                        .replace('{nivelTema}', 2) 
3420                        .replace('{categoriaParentId}', tema.categoryId); 
3421 
3422											// Armazena os subtemas deste tema 
3423
3424													.ajax( 
3425
3426																url : urlSubTema, 
3427																type : 'get', 
3428																data : {}, 
3429                                async: false 
3430															}) 
3431													.done( 
3432															function(subtemas) { 
3433																subtemasStorage 
3434																		.set( 
3435																				tema.categoryId, 
3436																				JSON 
3437																						.parse(subtemas)); 
3438 
3439															}); 
3440										}); 
3441 
3442						temas = temasLista; 
3443										 
3444						displayCursosPorTema(); 
3445 
3446						$('.todos').addClass('ativo'); 
3447  
3448					}).fail(function(jqXHR, textStatus, msg) { 
3449				// alert(msg); 
3450			}); 
3451
3452 
3453/* 
3454 * Exibe a lista de subtemas no mouse over do tema 
3455 */ 
3456function displaySubTemasLista(categoryId) { 
3457	$('#filtro-temas-nivel-2').empty(); 
3458	$('#filtro-temas-nivel-2').removeClass('d-none'); 
3459	 
3460  const btnTodos = $('<a href="#a" '  
3461        + ' class="subtema btn-nivel-3 subtema-ativo todos" ' 
3462				+ '" data-nvl="2" >' 
3463				+ 'Todos' 
3464				+ '</a>') 
3465 
3466  $('#filtro-temas-nivel-2').append(btnTodos); 
3467 
3468  if(!subtemasStorage.get(activeCategory.categoryId) || !subtemasStorage.get(activeCategory.categoryId).length) 
3469    $('#filtro-temas-nivel-2 .subtema-ativo.todos').hide() 
3470         
3471	$.each(subtemasStorage.get(activeCategory.categoryId), function(k, t) { 
3472		$('#filtro-temas-nivel-2').append('<a href="#a" class="subtema btn-nivel-3" data-tema="' 
3473				+ t.categoryId 
3474				+ '" data-nvl="2" >' 
3475				+ t.name 
3476				+ '</a>'); 
3477	}); 
3478
3479 
3480//Carregar mais 
3481$(window).scroll(function() { 
3482	 
3483	var element = document.querySelector('#carregar-mais'); 
3484	 
3485	if(element != null && !carregandoMais){ 
3486		var position = element.getBoundingClientRect(); 
3487	 
3488		// carregar maios 
3489		if(position.top >= 0 && position.bottom <= window.innerHeight) { 
3490			// enableScroll(false); 
3491			var qtCardsSubTema = $('#cursos-por-subtema-container .ssp-card-curso').not('.d-none').length; 
3492			if(qtCardsSubTema > 0){ 
3493				offsetTodosCursos = qtCardsSubTema; 
3494				$('.section-carregar-mais').remove(); 
3495			}else{ 
3496				offset = $('.cursos-por-categoria').not('.d-none').length; 
3497
3498 
3499      const urlParamsTemaNv3 = new URLSearchParams(window.location.search); 
3500      urlParamTemaNv3 = urlParamsTemaNv3.get('q'); 
3501 
3502      if(!urlParamTemaNv3) 
3503			  displayCursosPorTema();			 
3504
3505
3506	 
3507}); 
3508 
3509function enableScroll(enable) { 
3510    if(enable === false) document.body.classList.add("stop-scrolling") 
3511    else document.body.classList.remove("stop-scrolling"); 
3512    carregandoMais = !enable; 
3513
3514 
3515function hideOthersLevel1(elementShow){ 
3516  document.querySelectorAll('#temas .ssp-section-tema__container-menu-item a') 
3517  .forEach(a => a != elementShow ? a.classList.add('d-none') : undefined) 
3518
3519 
3520function hideOthersLevel2(elementShow){ 
3521	document.querySelectorAll('#filtro-temas-nivel-2 a') 
3522	.forEach(a => a != elementShow ? a.classList.add('d-none') : undefined) 
3523
3524 
3525function hideOthersLevel3(elementShow){ 
3526	document.querySelectorAll('#filtro-temas-nivel-3 a') 
3527	.forEach(a => a != elementShow ? a.classList.add('d-none') : undefined) 
3528
3529 
3530function showAllLevel1(){ 
3531  document.querySelectorAll('#temas .ssp-section-tema__container-menu-item a') 
3532  .forEach(btn => { 
3533    btn.classList.remove('d-none') 
3534    btn.classList.remove('ativo') 
3535    btn.classList.remove('tema-ativo') 
3536  }) 
3537
3538 
3539function showAllLevel2(){ 
3540  document.querySelectorAll('#filtro-temas-nivel-2 a') 
3541  .forEach(btn => { 
3542    btn.classList.remove('d-none') 
3543    btn.classList.remove('subtema-ativo') 
3544  }) 
3545
3546 
3547function showAllLevel3(){ 
3548  document.querySelectorAll('#filtro-temas-nivel-3 a') 
3549  .forEach(btn => { 
3550    btn.classList.remove('d-none') 
3551    btn.classList.remove('subtema-ativo') 
3552  }) 
3553
3554 
3555function removeFiltersLevel1() { 
3556  showAllLevel1() 
3557 
3558  const btnActived = document.querySelector('#temas .ssp-section-tema__container-menu-item .todos') 
3559  btnActived.click() 
3560
3561 
3562function removeFiltersLevel2() { 
3563  const btnActived = document.querySelector('#temas .tema-ativo') 
3564  btnActived.click() 
3565 
3566  new Promise(() => btnActived.click()) 
3567
3568 
3569function removeFiltersLevel3() { 
3570  const btnActivedNivel2 = document.querySelector('#filtro-temas-nivel-2 .subtema-ativo:not(.todos)') 
3571  const temaNivel2 = btnActivedNivel2.getAttribute('data-tema') 
3572 
3573  removeFiltersLevel2() 
3574 
3575  const intervalNível2 = setInterval(() => { 
3576    const btn = document.querySelector('[data-tema="' + temaNivel2 + '"]') 
3577 
3578    if(btn) { 
3579      btn.click() 
3580      $('.ssp-loader-content').parent().remove(); 
3581      clearInterval(intervalNível2) 
3582
3583  }, 200); 
3584
3585 
3586function clickTema(categoryId) { 
3587  return new Promise(resolve => { 
3588    const interval = setInterval(() => { 
3589      const el = document.querySelector('[data-tema="' + categoryId + '"]') 
3590   
3591      if(el) { 
3592        el.click() 
3593        clearInterval(interval) 
3594        resolve() 
3595
3596    }, 200); 
3597  }) 
3598
3599 
3600function getSubtemas(categoryFriendlyUrl, parentCategoryId) { 
3601  return $.ajax({ 
3602    url : '/o/senac-unidade-services/categoriaPorFriendlyURL/'+categoryFriendlyUrl+"/"+(parentCategoryId || 0), 
3603    type : 'get', 
3604    dataType: 'json', 
3605    async: false 
3606  }) 
3607
3608 
3609function getCategoriesIdNivel3Actived() { 
3610  const categories = [] 
3611 
3612  document.querySelectorAll("#filtro-temas-nivel-3 a.subtema-ativo") 
3613  .forEach(a => categories.push(parseInt(a.getAttribute('data-tema')))) 
3614 
3615  return categories 
3616
3617 
3618function getCurrentLevel() { 
3619  let level = 1 
3620   
3621  if(document.querySelector('#temas .tema-ativo')) 
3622    level = 1 
3623 
3624  if(document.querySelector('#filtro-temas-nivel-2 .subtema-ativo')) 
3625    level = 2 
3626   
3627  if(document.querySelector('#filtro-temas-nivel-3 .subtema-ativo')) 
3628    level = 3 
3629 
3630  return level 
3631
3632 
3633 
3634</script>