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