{"id":541,"date":"2024-10-02T14:48:19","date_gmt":"2024-10-02T13:48:19","guid":{"rendered":"https:\/\/www.ipleiria.pt\/estm\/?page_id=541"},"modified":"2025-10-28T15:09:29","modified_gmt":"2025-10-28T15:09:29","slug":"pessoas","status":"publish","type":"page","link":"https:\/\/www.ipleiria.pt\/estm\/escola\/quem-somos\/pessoas\/","title":{"rendered":"Pessoas"},"content":{"rendered":"    <section aria-describedby=\"peoples-section-title\">\n        <h2 id=\"peoples-section-title\" class=\"sr-only\">Pesquisa por pessoas<\/h2>\n        <form id=\"peoples-search\" name=\"peoples-search\" class=\"peoples-as-list\" data-customfields=\"office,extensao,email,orcid,ciencia-vitae\" data-api-url=\"https:\/\/www.ipleiria.pt\/estm\/wp-json\/wp\/v2\" aria-controls=\"peoples-list\">\n                        <div class=\"container\">\n                <div class=\"row\">\n                                        <div class=\"col-sm  p-0 mb-1\">\n                        <label for=\"people_position\" class=\"sr-only\">Cargo: <\/label>\n                        <select id=\"people_position\" name=\"people_position\" class=\"custom-select custom-select-sm people-taxonomy-filter disabled-filter\" data-api-url=\"${apiUrl}\/${taxonomy}?type=people\" data-include=\"\" data-exclude=\"without-category\"  style=\"-webkit-appearance: none;-moz-appearance: none; appearance: none;\">\n                            <option value=\"\" class=\"font-weight-bold taxonomy-label\">Cargo: <\/option>\n                        <\/select>\n                    <\/div>\n                <\/div> \n                \n                <div class=\"row\">\n                    <label for=\"search-field\" class=\"sr-only\">Campo de pesquisa<\/label>\n                    <input id=\"search-field\" type=\"text\" class=\"peoples-search-input form-control form-control-xs mt-2 mb-5 people-search-filter disabled-filter\" name=\"search\" value=\"\" placeholder=\"Pesquisa...\" data-api-url=\"${apiUrl}\/people\" >\n                <\/div>\n                \n                <input style=\"display: none;\" type=\"submit\" value=\"Executar pesquisa\">\n            <\/div>\n            \n            <div id=\"peoples-container\">\n                <h3 id=\"peoples-list-title\" class=\"peoples-list-title sr-only\">Pessoas<span class=\"sr-only\">: <\/span><\/h3>\n                <div id=\"peoples-list\" class=\"\" aria-live=\"polite\" >\n                    <div class=\"container\">A carregar&#8230;<\/div>\n                <\/div>\n                <div>\n                    <div class=\"wp-block-button is-style-theme-button-solid mt-4 mt-lg-0 text-center\">\n                        <button id=\"loading-button\" class=\"hide-if-no-js wp-block-button__link\"><span class=\"loading-label\">Mostrar mais<\/span>\u00a0<\/button>\n                    <\/div>\n                <\/div>\n            <\/div>\n        <\/form>\n    <\/section>\n <script>\n            (function(isSupported){\n            'use strict';\n            \n            document.head.insertAdjacentHTML(\"beforeend\", `\n                <style>\n                    #peoples-search .people-search-filter,\n                    #peoples-search .people-taxonomy-filter{\n                        transition: opacity 0.5s;\n                        font-size: 1rem;\n                       \n                    }\n                    #peoples-search .disabled-filter{\n                        visibility: hidden;\n                        opacity: 0;\n                    }\n                    #peoples-search .enabled-filter{\n                        visibility: visible;\n                        opacity: 1;\n                    }\n                    \n                    #peoples-search .peoples-layout-btn-group{\n                        padding-top: calc(0.25rem - 1px);\n                    }\n                    #peoples-search .peoples-layout-btn svg{\n                        fill: #030303;\n                        height: calc(1.5em - 0.25rem);\n                        width: auto;\n                        pointer-events: none;\n                    }\n                    #peoples-search .btn-light:not(:disabled):not(.disabled):active, \n                    #peoples-search .show>.btn-light.dropdown-toggle {\n                        color: #FFFFFF;\n                        background-color: #030303;\n                        border-color: #000000;\n                    }\n                    \n                    #peoples-search .btn-light:not(:disabled):not(.disabled):active svg{\n                        fill: #FFFFFF\n                    }\n                    \n                    #peoples-search .peoples-list-title{\n                        background-color: #f2f2f2;\n                        color: #666666;\n                        vertical-align: middle;\n                        padding: .75rem;\n                        font-size: 1rem;\n                        margin: 40px 0 30px;\n                    }#peoples-list{\n                        min-height: 60px;\n                    }\n                    .loading{\n                        position: relative;\n                    }\n                                        .loading:after {\n                        content: '';\n                        display: inline-block;\n                        width: 1.5rem;\n                        height: 1.5rem;\n                        vertical-align: text-bottom;\n                        border: .25em solid currentColor;\n                        border-right-color: transparent;\n                        border-radius: 50%;\n                        animation: spinner-border .75s linear infinite;\n                        position: absolute;\n                        z-index: 3;\n                        left: calc(50% - 0.75rem);\n                        top: 0.75rem;\n                    }.peoples-as-list #peoples-list ul{\n                        list-style: none;\n                        padding: 0;\n                    }\n                    .peoples-as-list #peoples-list ul li {\n                        display: flex;\n                        flex-direction: column;\n                    }\n                    .peoples-as-list #peoples-list .people-link {\n                        line-height: 1.7rem;\n                        padding: 15px 0.75rem;\n                        margin: 0;\n                        border-bottom: 1px solid var(--wp--preset--color--cyan-bluish-gray);\n                        font-weight: 700;\n                        \/*display: flex;\n                        flex-direction: row;\n                        justify-content: space-between;\n                        align-items: center;*\/\n                    }\n                    .peoples-as-list #peoples-list .people-link,\n                    .peoples-as-list #peoples-list .people-link:link,\n                    .peoples-as-list #peoples-list .people-link:visited{\n                        color: var(--dark);\n                        text-decoration: none;\n                        color: #262626;\n                        font-weight: 400;\n\n                    }.peoples-as-list #peoples-list .people-link:hover:before,\n                    .peoples-as-list #peoples-list .people-link:focus:before,\n                    .peoples-as-list #peoples-list .people-link:active:before{\n                        border-color: var(--blue);\n                    }\n                    .peoples-as-list #peoples-list .people-link:before {\n                        display: none;\n                        width: 15px;\n                        height: 15px;\n                        border-color: var(--dark);\n                        border-right: 1px solid;\n                        border-top: 1px solid;\n                        transform: rotate(45deg);\n                        margin: 20px;\n                        content: ' ';\n                        position: absolute;\n                        right: 0;\n                        top: calc(50% - 23px);\n                    }\n                    \n                    .peoples-as-list #peoples-list .people-link .title{\n                        display: block;\n                        font-weight: 600;\n                        text-transform: none;\n                        font-size: 1.1rem;                         line-height: 2.2rem;\n                        order: 0;\n                        \/*width: 30%;*\/\n                    }\n                    \n                    .peoples-as-list #peoples-list .people-link .title {\n                        padding: 0 5px;\n                        \/*width: 35%;*\/\n                    }\n                    \n                    .peoples-as-list #peoples-list .people-link .taxonomy-wrapper {\n                        padding: 0 5px;\n                        \/*width: 20%;*\/\n                    }\n                    \n                    .peoples-as-list #peoples-list .people-link .meta{\n                        display: grid;\n                        color: var(--dark);\n                        \/*order: 2;*\/\n                        gap: 0 10px;\n                        margin-bottom: 0.4rem;\n                        padding: 0 5px;\n                    }\n                    .peoples-as-list #peoples-list .people-link .meta .taxonomy{\n                        font-size: 0.9rem;\n                        line-height: 1rem;\n                    }\n                    .peoples-as-list #peoples-list .people-link .meta .taxonomy-label,\n                    .peoples-as-list #peoples-list .people-link .date-label{\n                        text-align: left;\n                        padding: 0;\n                        overflow: hidden;\n                        clip: rect(0, 0, 0, 0);\n                        white-space: nowrap;\n                        border: 0;\n                        order: 0;\n                        font-weight: 600;\n                        color: #8c8c8c;\n                    }\n                    .people-as-list #people-list div .meta .taxonomy {\n                        font-size: 0.9rem;\n                        line-height: 1rem;\n                    }\n                    .peoples-as-list #peoples-list .people-link .meta .taxonomies-separator {\n                        padding: 0;\n                    }\n                    .peoples-as-list #peoples-list .people-link .meta .taxonomy:not([style*=\"display:none\"]):last-child:after,\n                    .peoples-as-list #peoples-list .people-link .people-thumbnail-wrapper{\n                         display: flex;\n                    }\n                    \n                    .peoples-as-list #peoples-list .people-link .taxonomy.taxonomy-label,\n                    .peoples-as-list #peoples-list .people-link .date-label{\n                        padding: 0;\n                        overflow: hidden;\n                        clip: rect(0, 0, 0, 0);\n                        white-space: nowrap;\n                        border: 0;\n                    }\n                    .peoples-as-list #peoples-list .people-link .taxonomy.taxonomy-value {\n                        vertical-align: middle;\n                        font-weight: 400;\n                        \/*margin-top: 0.2rem;*\/\n                        white-space: nowrap;\n                        text-overflow: ellipsis;\n                        overflow: hidden;\n                        color: #8c8c8c;\n                       \n                    }\n                    .peoples-as-list #peoples-list .people-link .taxonomy.taxonomy-categories-value {\n                        background-color: var(--blue);\n                        color: var(--white);\n                        padding: 0.4rem 0.6rem !important;\n                    }\n                    .peoples-as-list #peoples-list .people-link .taxonomy-tags-wrapper{\n                        flex-grow: 1;\n                        min-width: 0;\n                    }\n                    .peoples-as-list #peoples-list .people-link .date-wrapper{\n                        order: 3;\n                        margin: 0.4rem 0 0;\n                    }\n                    .peoples-as-list #peoples-list .people-link .date-value {\n                        font-size: 0.9rem;\n                        font-weight: normal;\n                    }\n                    \n                    \n                    #peoples-search.peoples-as-list .peoples-list-title{\n                        margin-bottom: 0;\n                    }\n                    \n                    #peoples-search.peoples-as-list .new-icon{\n                        margin-top: -15px;\n                        margin-right: -10px;\n                        width: 1.5rem;\n                    }\n                    \n                    .peoples-as-list .people-thumbnail{border-radius: 50%;\n                        height: auto;\n                        width: 100px;\n                    }\n                    \n                    .department{\n                        order: 6;\n                    }\n                    \n                    .people-email-wrapper{\n                        order: 1;\n                    }\n                    .people-office-wrapper{\n                        order: 2;\n                    }\n                    .people-orcid-wrapper{\n                        order: 3;\n                    }\n                    .people-ciencia-vitae-wrapper{\n                        order: 4;\n                    }\n                    \n                    .departmentAlign{\n                        margin-left: 90px;\n                        width: 15em;\n                    }\n                    \n                    .teste{\n                        display: flex;\n                        flex-direction: column;\n                        top: 0;\n                        bottom: 0;\n                        left: 0;\n                        right: 0;\n                        align-items: left;\n                    }\n                    \n                    .people-office{\n                       text-align: left; \n                    }.peoples-as-grid #peoples-list ul{\n                        display: flex;\n                        flex-wrap: wrap;\n                        margin-right: -15px;\n                        margin-left: -15px;\n                        list-style: none;\n                        padding: 0;\n                    }\n                    .peoples-as-grid #peoples-list ul li{\n                        position: relative;\n                        width: 100%;\n                        padding-right: 15px;\n                        padding-left: 15px;\n                    }\n                    .peoples-as-grid #peoples-list .people-link{\n                        display: flex;\n                        flex-direction: column;\n                        width: 100%;\n                        margin-bottom: 30px;\n                        position: relative;\n                        color: var(--dark);\n                        font-weight: 700;\n                        text-decoration: none;\n                        aspect-ratio: 1\/1;\n                    }\n                    .peoples-as-grid #peoples-list .people-link:hover,\n                    .peoples-as-grid #peoples-list .people-link:focus,\n                    .peoples-as-grid #peoples-list .people-link:active{\n                        color: var(--thumbnail-background-color, var(--blue));\n                    }\n                    .peoples-as-grid #peoples-list .people-link>.title{\n                        display: flex;\n                        flex-direction: column;\n                        position: absolute;\n                        width: 100%;\n                        height: 35%;\n                        top: 0;\n                        bottom: 0;\n                        left: 0;\n                        right: 0;\n                        text-align: center;\n                        align-items: center;\n                        justify-content: center;\n                        overflow: hidden;\n                        text-overflow: ellipsis;\n                        word-break: break-word;\n                        padding: 15px;\n                        z-index: 2;\n                        font-weight: 600;\n                        text-transform: none;\n                        color: white;\n                        font-size: 1.2rem;\n                        line-height: 1.3rem;\n                        order: 3;\n                    }\n                    .peoples-as-grid #peoples-list .people-link>.meta{\n                        order: 2;\n                        gap: 0 15px;\n                        margin-bottom: 0.4rem;\n                        width: 50%; \n                    }\n                    .peoples-as-grid #peoples-list .people-link .taxonomy.taxonomy-label,\n                    .peoples-as-grid #peoples-list .people-link .date-label{\n                        position: absolute;\n                        width: 1px;\n                        height: 1px;\n                        padding: 0;\n                        overflow: hidden;\n                        clip: rect(0, 0, 0, 0);\n                        white-space: nowrap;\n                        border: 0;\n                    }\n                    .peoples-as-grid #peoples-list .people-link .taxonomy.taxonomy-value {\n                        vertical-align: middle;\n                        font-weight: normal;\n                    \n                        margin-top: 0.6rem;\n                        white-space: nowrap;\n                        text-overflow: ellipsis;\n                        overflow: hidden;\n                        color: var(--wp--preset--color--black);\n                        font-weight: 600;\n                    }\n                    .peoples-as-grid #peoples-list .people-link .taxonomy.taxonomy-categories-value {\n                        background-color: var(--blue);\n                        color: var(--white);\n                        padding: 0rem 0.8rem !important;\n                    }\n                    .peoples-as-grid #peoples-list .people-link .taxonomy-tags-wrapper{\n                        flex-grow: 1;\n                        min-width: 0;\n                    }\n                    .peoples-as-grid #peoples-list .people-link .people-thumbnail-wrapper{\n                        display: block;\n                        width: 100%;\n                        height: 100%;\n                        color: var(--white, white);\n                        background-color: var(--thumbnail-background-color, var(--dark));\n                        order: 1;\n                        border: 1px solid #ebebec;\n                    }\n                    .peoples-as-grid #peoples-list .people-link .people-thumbnail-wrapper .people-thumbnail-text{\n                        display: flex;\n                        flex-direction: column;\n                        justify-content: center;\n                        align-items: flex-start;\n                        height: 100%;\n                        padding: 3rem;\n                        font-weight: 800;\n                        font-size: 2rem;\n                        line-height: 2.5rem;\n                        text-transform: none;\n                    }\n                    .peoples-as-grid #peoples-list .people-link .people-thumbnail{\n                        display: block;\n                        width: 100%;\n                        height: auto;\n                        background-color: #1c1c1c;\n                        opacity: .5;\n                    }\n                    .peoples-as-grid #peoples-list .people-link .date-wrapper{\n                        order: 4;\n                        margin: 0.4rem 0 0;\n                    }\n                    .peoples-as-grid #peoples-list .people-link .date-value {\n                        font-size: 0.9rem;\n                        font-weight: normal;\n                    }\n                    .taxonomy-wrapper.taxonomy-school-wrapper,\n                    .taxonomy-wrapper.taxonomy-tags-wrapper{\n                        overflow: hidden;\n                        text-overflow: ellipsis;\n                        display: none;\n                    }\n                    @media (min-width: 576px){\n                        .peoples-as-grid #peoples-list ul li{\n                            flex: 0 0 50%;\n                            max-width: 50%;\n                        }\n                    }\n                    @media (min-width: 768px){\n                        .peoples-as-grid #peoples-list ul li{\n                            flex: 0 0 33.33333%;\n                            max-width: 33.33333%;\n                        }\n                    }\n                    @media (min-width: 992px){\n                        .peoples-as-grid #peoples-list ul li{\n                            flex: 0 0 25%;\n                            max-width: 25%;\n                        }\n                    }\n                    \n                    .peoples-as-grid #peoples-list .new-icon{\n                        position: absolute;\n                        top: 0;\n                        left: 0;\n                        width: 3rem;\n                    }\n                    \n                    .peoples-as-grid #peoples-list .custom-field{\n                        display:none;\n                    }\n                    \n                    .peoples-layout-btn{\n                        border-color: transparent;\n                    }\n                    \n                    #loading-button{\n                        line-height: 1.3rem;\n                    }\n                    \n                   \n                <\/style>\n            `);\n            \n            const taxonomiesInfo = {};\n            \n            const getForm = () => {\n                return document.querySelector('form#peoples-search');\n            };\n            \n            const getContainer = ()=>{\n                const form = getForm();\n                return !!form?form.querySelector('#peoples-list'):null;\n            };\n            \n            const getLoading = () => {\n                const form = getForm();\n                return !!form?form.querySelector('#loading-button'):null;\n            };\n            \n            const enableLoading = (loading=false) => {\n                const loadingButton = getLoading();\n                if(loadingButton){\n                    const loadingLabel = loadingButton.querySelector('.loading-label');\n                    if(!!loadingLabel){\n                        loadingLabel.style.display = loading?'none':'initial';\n                    }\n                    if(loading){\n                        loadingButton.classList.add(\"loading\");\n                        loadingButton.style.display = 'inline-block';\n                    }else{\n                        if(ofPages()<=currentPage()){\n                            loadingButton.style.display = 'none';\n                        }\n                        loadingButton.classList.remove(\"loading\");\n                    }\n                    loadingButton.setAttribute(\"aria-busy\", Boolean(loading));\n                    loadingButton.dataset.loading =  Boolean(loading);\n                }\n            };\n            \n            const isLoading = () => {\n                const loadingButton = getLoading();\n                return !!loadingButton && String(loadingButton.dataset.loading).toLowerCase() === \"true\";\n            };\n            \n            const currentPage = () => {\n                const loadingButton = getLoading();\n                return !!loadingButton && !!loadingButton.dataset.page ? parseInt(loadingButton.dataset.page) : 0 ;\n            };\n            \n            const ofPages = () => {\n                const loadingButton = getLoading();\n                return !!loadingButton && !!loadingButton.dataset.totalPages ? loadingButton.dataset.totalPages : 0 ;\n            };\n            \n            const doGetApiRequest = (url, page=1, allPages=false) => {\n                let totalPages = 0;\n                \n                const loadingButton = getLoading();\n                if(loadingButton && !allPages){\n                    loadingButton.dataset.page = page;\n                }\n                \n                return fetch( url, {\n                    \/\/credentials: 'omit',\n                    mode: 'cors'\n                })\n                .then( response => {\n                    if (response.status === 200) {\n                        const contentType = response.headers.get('content-type');\n                        totalPages = response.headers.get('X-WP-TotalPages');\n                        if(loadingButton && !allPages){\n                            loadingButton.dataset.totalPages = totalPages;\n                        }\n                        if (!contentType || !contentType.includes('application\/json')) {\n                            throw new TypeError(\"Resposta JSON inv\u00e1lida\");\n                        }\n                        return response.json();\n                    }\n                })\n                .then( response => {\n                    if (page>1 || totalPages<=1) {\n                        return response;\n                    }else if(allPages){\n                        let pageUrl = new URL(url);\n                        let params = new URLSearchParams(url.search);\n                        const requests = Array.from({length:(totalPages-1)},(v,k)=>k+1+1).map(page=>{\n                            params.set('page', page);\n                            pageUrl.search = params.toString();\n                            return doGetApiRequest(pageUrl.toString(), page, allPages);\n                        });\n                        return Promise.all(requests)\n                            .then(responses => {\n                                return response.concat(responses.flat());\n                            });\n                    }\n                    return response;\n                })\n                .catch(err => {\n                    \/\/console.error('Erro: ', err);\n                    const container = document.getElementById('peoples-list');\n                    if(!!container){\n                        container.innerHTML = `Erro`;\n                    }\n                    enableLoading(false);\n                    return err;\n                });\n            };\n            \n            \n            const syncState = () => {\n                const form = getForm();\n                history.replaceState({ 'peopleSearch': Object.fromEntries(new FormData(form)) }, '');\n            };\n            \n            const doSearch = (page=1) => {\n                const form = getForm();\n                const input = form.querySelector('.peoples-search-input');\n                const container = getContainer();\n                \n                const custom_fields = form.dataset.customfields?form.dataset.customfields.split(',').map(field=>field.trim()):[];\n                const custom_fields_labels = {\n                    'office':'Gabinete',\n                    'email':'E-mail',\n                    'extensao':'Extens\u00e3o',\n                    'orcid':'ORCID',\n                    'ciencia-id':'Ci\u00eancia ID',\n                    \n                };\n                \n                const url = new URL(input.dataset.apiUrl.replace(\/\\${apiUrl}\/,form.dataset.apiUrl));\n                const taxonomies = Object.keys(taxonomiesInfo);\n                const urlSearchParameters = new URLSearchParams({\n                    '_fields': 'title,content,date,link,_links,_embedded.wp:featuredmedia,meta.custompostfields_post-thumbnail-color,meta.custompostfields_post-thumbnail-text,'+taxonomies.join(\",\")+(custom_fields.length>0?','+custom_fields.map(field=>`meta.custompostfields_${field}`).join(','):''),\n                    '_embed':'wp:term,wp:featuredmedia',\n                    'context': 'view',\n                    'per_page': 12,\n                    'page': page,\n                    'orderby': 'title',\n                    'order': 'asc',\n                });\n                \n                enableLoading(true);\n                syncState();\n                \n                const formData = new FormData(form);\n                for (let [key, value] of formData.entries()) { \n                    if(!!value && value.length>0){\n                        urlSearchParameters.append(key, value);\n                    }\n                }\n                url.search = urlSearchParameters.toString();\n                \n                if(page<=1){\n                    container.innerHTML = '<ul class=\"peoples-list-items-container no-bullets\" role=\"group\" aria-describedby=\"peoples-list-title\"><\/ul>';\n                }\n                \n                return doGetApiRequest(url, page).then(posts => {\n                    if(!posts || typeof posts[Symbol.iterator] !== 'function'){\n                        if(page<=1){\n                            container.innerHTML = '';\n                        }\n                        return posts;\n                    }\n                    if(posts.length<=0){\n                        container.innerHTML = 'Sem dados a apresentar.';\n                    }else{\n                        const itemsContainer = container.querySelector('.peoples-list-items-container');\n                        if(!!itemsContainer){\n                            let output = '';\n                            let postType = '';\n                            let postTypeSlug = '';\n                            \n                            const metaExcludeTaxonomy = [\n                                'resource_status'\n                            ];\n                            \n                            for ( let post of posts ) {\n                                console.log(post);\n                                \n                                let meta = `<dl title=\"Informa\u00e7\u00f5es adicionais:\" class=\"meta d-md-flex justify-content-flex-start\">`;\n                                \n                                \n                                                                meta += taxonomies.map(taxonomy=>{\n                                    if(metaExcludeTaxonomy.includes(taxonomy)){\n                                        return '';\n                                    }\n                                    \n                                    let info =  (Array.isArray(post[taxonomy]) && taxonomiesInfo[taxonomy])?post[taxonomy].map(id=>{\n                                        return (taxonomiesInfo[taxonomy][id] && taxonomiesInfo[taxonomy][id].name && taxonomiesInfo[taxonomy][id].name.length>0)?taxonomiesInfo[taxonomy][id].name:'';\n                                    }).join('<span class=\"taxonomy-separator\">, <\/span>'):false;\n                                    \n                                    if(taxonomy==='category'){\n                                        postType = info;\n                                        postTypeSlug = (Array.isArray(post[taxonomy]) && taxonomiesInfo[taxonomy])?post[taxonomy].map(id=>{\n                                            return (taxonomiesInfo[taxonomy][id] && taxonomiesInfo[taxonomy][id].slug && taxonomiesInfo[taxonomy][id].slug.length>0)?taxonomiesInfo[taxonomy][id].slug:false;\n                                        }).join(', '):'';\n                                    }\n                                    \n                                    return (info && taxonomiesInfo[taxonomy].label && taxonomiesInfo[taxonomy].label.length>0) ? (`\n                                        <div class=\"pr-md-2 taxonomy-${taxonomy}\" style=\"flex-basis:20%;\"> \n                                        <dt class=\"py-1 taxonomy taxonomy-label taxonomy-${taxonomy}-value\" style=\"text-wrap: wrap;\">${info}<span class=\"taxonomies-separator\"><\/span><\/dt><\/div>`):'';\n                                }).join('');\n\n                                                                meta +=(post.meta[`custompostfields_email`].length > 0 ? `\n                                    <div class=\"pr-md-2\" style=\"flex-basis:20%;\">\n                                        <dt class=\"py-1 taxonomy taxonomy-label taxonomy-email taxonomy-email-label\">${(custom_fields_labels['email']?custom_fields_labels['email']:'email')}<\/dt> \n                                        <dd class=\"pb-1 taxonomy taxonomy-value taxonomy-email-value people-email\"><a title='${(custom_fields_labels['email']?custom_fields_labels['email']:'email')}' rel='noreferrer noopener' target='_blank' href=\"mailto:${post.meta[`custompostfields_email`]}\">${post.meta[`custompostfields_email`]}<\/a><\/dd>\n                                    <\/div>`:'');\n                                    \n                                meta +=(post.meta[`custompostfields_office`].length > 0 ? `\n                                    <div class=\"pr-md-2\" style=\"flex-basis:10%;\">\n                                        <dt class=\"py-1 taxonomy taxonomy-label taxonomy-office taxonomy-office-label\">${(custom_fields_labels['office']?custom_fields_labels['office']:'office')}<\/dt> \n                                        <dd class=\"pb-1 taxonomy taxonomy-value taxonomy-office-value people-office\">${post.meta[`custompostfields_office`]}<\/dd>\n                                    <\/div>`:'');\n                                    \n                                meta +=(post.meta[`custompostfields_extensao`].length > 0 ? `\n                                    <div class=\"pr-md-2\" style=\"flex-basis:10%;\">\n                                        <dt class=\"py-1 taxonomy taxonomy-label taxonomy-extensao taxonomy-extensao-label\">${(custom_fields_labels['extensao']?custom_fields_labels['extensao']:'extensao')}<\/dt>\n                                        <dd class=\"pb-1 taxonomy taxonomy-value taxonomy-extensao-value people-extensao\">${post.meta[`custompostfields_extensao`]}<\/dd>\n                                    <\/div>`:'');\n                                    \n                                    \n                                meta +=(post.meta[`custompostfields_orcid`].length > 0  ? `\n                                    <div class=\"pr-md-2\" style=\"flex-basis:20%;\">\n                                        <dt class=\"py-1 taxonomy taxonomy-label taxonomy-extensao taxonomy-extensao-label\">${(custom_fields_labels['orcid']?custom_fields_labels['orcid']:'ORDIC')}<\/dt>\n                                        <dd class=\"pb-1 taxonomy taxonomy-value taxonomy-extensao-value people-extensao\"><a title='${(custom_fields_labels['orcid']?custom_fields_labels['orcid']:'')}' rel='noreferrer noopener' target='_blank' href=\"https:\/\/orcid.org\/${post.meta[`custompostfields_orcid`]}\">${post.meta[`custompostfields_orcid`]}<\/a><\/dd>\n                                    <\/div>`:'');\n                                    \n                                meta +=(post.meta[`custompostfields_ciencia-vitae`].length > 0  ? `\n                                    <div class=\"pr-md-2\" style=\"flex-basis:20%;\">\n                                        <dt class=\"py-1 taxonomy taxonomy-label taxonomy-extensao taxonomy-extensao-label\">${(custom_fields_labels['ciencia-id']?custom_fields_labels['ciencia-id']:'Ci\u00eancia ID')}<\/dt>\n                                        <dd class=\"pb-1 taxonomy taxonomy-value taxonomy-extensao-value people-extensao\"><a title='${(custom_fields_labels['ciencia-id']?custom_fields_labels['ciencia-id']:'')}' rel='noreferrer noopener' target='_blank' href=\"https:\/\/www.cienciavitae.pt\/${post.meta[`custompostfields_ciencia-vitae`]}\">${post.meta[`custompostfields_ciencia-vitae`]}<\/a><\/dd>\n                                    <\/div>`:'');\n                                    \n                               \/* meta += (post.meta[`custompostfields_orcid`].length > 0 || post.meta[`custompostfields_ciencia-vitae`].length > 0)? `<div class=\"pr-md-2\">\n                                        <dt class=\"py-1 taxonomy taxonomy-label taxonomy-id-cientifico taxonomy-id-cientifico-label\">${(custom_fields_labels['orcid']?custom_fields_labels['orcid']:'Ci\u00eancia ID')}<\/dt>\n                                        <dd class=\"pb-1 taxonomy taxonomy-value taxonomy-orcid-value people-id-cientifico\">`:'';\n                                \n                                meta += (post.meta[`custompostfields_orcid`].length > 0 ? `<a title='${(custom_fields_labels['orcid']?custom_fields_labels['orcid']:'')}' rel='noreferrer noopener' target='_blank' href=\"https:\/\/orcid.org\/${post.meta[`custompostfields_orcid`]}\">${post.meta[`custompostfields_orcid`]}<\/a>`: '');\n                                \n                                meta += (post.meta[`custompostfields_ciencia-vitae`].length > 0 && post.meta[`custompostfields_ciencia-vitae`].length > 0)?`<br>`:'';\n                                \n                                meta += post.meta[`custompostfields_ciencia-vitae`].length > 0 ? `<a title='${(custom_fields_labels['ciencia-id']?custom_fields_labels['ciencia-id']:'')}' rel='noreferrer noopener' target='_blank' href=\"https:\/\/www.cienciavitae.pt\/${post.meta[`custompostfields_ciencia-vitae`]}\">${post.meta[`custompostfields_ciencia-vitae`]}<\/a>`: '';\n                                \n                                meta += (post.meta[`custompostfields_orcid`].length > 0 || post.meta[`custompostfields_ciencia-vitae`].length > 0)? `<\/dd><\/div>` : '';\n                                *\/\n                                meta += '<\/dl>';\n                                \n                                let featuredMedia = '';\n                                const featuredMediaInfo = (post._embedded && Array.isArray(post._embedded[\"wp:featuredmedia\"]) && post._embedded[\"wp:featuredmedia\"].length>0)?post._embedded[\"wp:featuredmedia\"].shift():null;\n                                if(featuredMediaInfo && featuredMediaInfo.source_url){\n                                    const srcSet = [];\n                                    const sizes = '';\n                                    if(featuredMediaInfo.media_details && typeof featuredMediaInfo.media_details.sizes === 'object' && featuredMediaInfo.media_details.sizes !== null){\n                                        for (let [key, size] of Object.entries(featuredMediaInfo.media_details.sizes)) {\n                                            if(size.source_url && size.width){\n                                                srcSet.push(`${size.source_url} ${size.width}w`);\n                                            }\n                                        }\n                                        if(srcSet.length>0){\n                                            featuredMedia += ` srcset=\"${srcSet.join(', ')}\"`;\n                                        }\n                                    }\n                                    if(featuredMediaInfo.media_details.width){\n                                        featuredMedia +=` sizes=\"(max-width: ${featuredMediaInfo.media_details.width}px) 100vw, ${featuredMediaInfo.media_details.width}px\"`;\n                                    }\n                                    featuredMedia = `<span class=\"people-thumbnail-wrapper\"><img class=\"people-thumbnail\" loading=\"lazy\" alt=\"\" src=\"${featuredMediaInfo.source_url}\" ${featuredMedia}><\/span>`;\n                                }else{\n                                    const thumbnailText = post.meta[\"custompostfields_post-thumbnail-text\"]?post.meta[\"custompostfields_post-thumbnail-text\"]:'';\n                                    featuredMedia = `<span class=\"people-thumbnail-wrapper\"><span class=\"people-thumbnail-text\" aria-hidden=\"true\">${thumbnailText}<\/span><\/span>`;\n                                }\n                                \n                                const thumbnailColor = post.meta[\"custompostfields_post-thumbnail-color\"]?post.meta[\"custompostfields_post-thumbnail-color\"]:null;\n                                \n                                const date = post.date?`<dl class=\"date-wrapper\"><dt class=\"date-label\">Date: <\/dt><dd class=\"date-value\">${((new Date(post.date)).toLocaleDateString('en-GB', {year: 'numeric', month: 'long', day: 'numeric'}))}<\/dd><\/dl>`:'';\n                                \n                                output += `\n                                    <li> \n                                        <div data-href=\"${post.link}\" class=\"position-relative people-link\" style=\"${(thumbnailColor?`--thumbnail-background-color: ${thumbnailColor};`:'')}\">\n                                                                                        <span class=\"title\">${post.title.rendered}<span class=\"sr-only\">.\u00a0<\/span><\/span>\n                                            ${meta}\n                                        <\/div>\n                                    <\/li>\n                                    `;\n                            }\n                            itemsContainer.insertAdjacentHTML(\"beforeend\", output);\n                        }\n                    }\n                    enableLoading(false);\n                    return posts;\n                });\n            };\n            \n            document.addEventListener('DOMContentLoaded', () => {\n                const form = getForm();\n                if(!isSupported || form===undefined || form.dataset.apiUrl===undefined){\n                    return;\n                }\n                \n                enableLoading(true);\n                \n                if (form.querySelector('.peoples-layout-btn')) {\n                    form.querySelectorAll('.peoples-layout-btn').forEach((button) => {\n                        button.addEventListener(\"click\", function(event) {\n                            const input = form.querySelector('#peoples-layout');\n                            if(event.target.tagName === \"BUTTON\" && !form.classList.contains(event.target.id)){\n                                form.classList.remove(event.target.id===\"peoples-as-grid\"?\"peoples-as-list\":\"peoples-as-grid\");\n                                form.classList.add(event.target.id);\n                                if(input){\n                                    input.value = event.target.id;\n                                }\n                                form.querySelectorAll('.peoples-layout-btn.active').forEach((button) => {\n                                    button.classList.remove('active');\n                                    button.setAttribute('aria-checked', 'false');\n                                });\n                                button.classList.add('active');\n                                button.setAttribute('aria-checked', 'true');\n                            }\n                            syncState();\n                        });\n                    });\n                }\n                \n                const loadingButton = getLoading();\n                if(loadingButton){\n                    loadingButton.addEventListener(\"click\", function(event) {\n                        if(!isLoading() && (ofPages()>0 && ofPages()>currentPage())){\n                            doSearch(currentPage()+1).then(posts => {});\n                        }\n                        event.preventDefault();\n                    });\n                }\n                \n                const container = document.getElementById('peoples-list');\n                const taxonomiesRequests = Array.from(form.querySelectorAll(\".people-taxonomy-filter\")).map(taxonomy => {\n                \n                    if(! \"apiUrl\" in taxonomy.dataset || ! \"taxonomy\" in taxonomy.dataset){\n                        return;\n                    }\n                    const taxonomySlug = taxonomy.getAttribute(\"name\");\n                    const taxonomyLabel = taxonomy.querySelector(\".taxonomy-label\");\n                    const taxonomySelected = taxonomy.dataset.selected||'';\n                    const taxonomyInclude = taxonomy.dataset.include?taxonomy.dataset.include.split(','):[];\n                    const taxonomyExclude = taxonomy.dataset.exclude?taxonomy.dataset.exclude.split(','):[];\n                    taxonomiesInfo[taxonomySlug] = {};\n                    \n                    let url = new URL(taxonomy.dataset.apiUrl.replace(\/\\${apiUrl}\/, form.dataset.apiUrl).replace(\/\\${taxonomy}\/, taxonomySlug));\n                    url.search = new URLSearchParams({\n                        '_fields': 'id,slug,name,taxonomy,link,description,count',\n                        'context': 'view'\n                    }).toString();\n                    \n                    return doGetApiRequest(url, 1, true).then(terms => {\n                        if(typeof terms[Symbol.iterator] !== 'function'){\n                            return;\n                        }\n                        if(taxonomyLabel && taxonomyLabel.text){\n                            taxonomiesInfo[taxonomySlug]['label'] = taxonomyLabel.text;\n                        }\n                        for ( let term of terms ) {\n                            if((taxonomyInclude.length>0 && !taxonomyInclude.includes(term.slug)) || (taxonomyExclude.length>0 && taxonomyExclude.includes(term.slug))){\n                                continue;\n                            }\n                            \n                            taxonomiesInfo[taxonomySlug][term.id] = term;\n                            \n                            let option = document.createElement(\"option\");\n                            option.text = term.name;\n                            option.value = term.id;\n                            option.id = `select-${taxonomySlug}-${term.slug}`;\n                            if(term.slug===taxonomySelected){\n                                option.selected = true;\n                                option.setAttribute('selected', 'selected');\n                            }\n                            taxonomy.appendChild(option);\n                        }\n                        \n                        taxonomy.addEventListener('change', ()=>doSearch());\n                        taxonomy.classList.replace(\"disabled-filter\", \"enabled-filter\");\n                    });\n                });\n                \n                Promise.all(taxonomiesRequests).then(()=>{\n                    form.addEventListener('submit',  event => {\n                        doSearch();\n                        \n                        event.preventDefault();\n                    });\n                    \n                    \n                    const input = form.querySelector('.peoples-search-input');\n                    input.timeout = null;\n                    input.addEventListener('keyup', function (e) {\n                        clearTimeout(input.timeout);\n                    \n                        input.timeout = setTimeout(()=>{\n                            doSearch();\n                        }, 350);\n                    });\n                    input.addEventListener('blur', function (e) {\n                        clearTimeout(input.timeout);\n                    });\n                    input.classList.replace(\"disabled-filter\", \"enabled-filter\");if(history.state && history.state.peopleSearch){\n                        let formItem, formItemKey;\n                        for ( formItemKey in history.state.peopleSearch ) {\n                            if(history.state.peopleSearch[formItemKey] && history.state.peopleSearch[formItemKey].length>0 && (formItem = form.querySelector(`[name=\"${formItemKey}\"]:not([data-selected])`) )){\n                                formItem.value = history.state.peopleSearch[formItemKey];\n                            }\n                        }\n                        const input = form.querySelector('#peoples-layout');\n                        if(input && input.value.length>0 && !form.classList.contains(input.value)){\n                            form.classList.remove(input.value===\"peoples-as-grid\"?\"peoples-as-list\":\"peoples-as-grid\");\n                            form.classList.add(input.value);\n                            form.querySelectorAll('.peoples-layout-btn').forEach((button) => {\n                                if(button.id == input.value){\n                                    button.classList.add('active');\n                                    button.setAttribute('aria-checked', 'true');\n                                }else{\n                                    button.classList.remove('active');\n                                    button.setAttribute('aria-checked', 'false');\n                                }\n                            });\n                        }\n                    }\n                    doSearch().then(posts => {const loadingButton = getLoading();\n                        if(loadingButton){\n                            (new IntersectionObserver((targets)=>{\n                                targets.forEach((target) => {\n                                    if (target.isIntersecting && target.intersectionRatio >= 0.75 && !isLoading() && (ofPages()>0 && ofPages()>currentPage())) {\n                                        target.target.dispatchEvent(new MouseEvent('click', {\n                                            view: window,\n                                            bubbles: true,\n                                            cancelable: true\n                                        }));\n                                    }\n                                });\n                            }, {\n                              root: null,\n                              rootMargin: '0px',\n                              threshold: 1.0\n                            })).observe(loadingButton);\n                        }\n                    });\n                });\n            });\n        })(\n               \"fetch\" in window \n            && \"URL\" in window \n            && \"URLSearchParams\" in window \n            && \"FormData\" in window\n            && \"Promise\" in window\n            && \"history\" in window\n            && \"querySelector\" in document\n            && \"querySelectorAll\" in document\n            && \"includes\" in Array()\n            && \"from\" in Array\n            && (function(){\n                try{\n                    Function(\"() => {};\"); \n                    Function(\"class Feature {};\");\n                    return true;\n                }catch(exception){\n                    return false;\n                }\n            })()\n        );\n     \n     \/*console.log(\"Ol\u00e1\");\n     fetch('https:\/\/www.ipleiria.pt\/wp-json\/wp\/v2\/course').then(response=>response.json()).then(json=>{\n         console.log(json);\n     });*\/\n <\/script>\n <noscript>\n     O JavaScript n\u00e3o \u00e9 suportado pelo seu navegador.\n    <a href=\"&#x2F;estm&#x2F;wp-json&#x2F;wp&#x2F;v2&#x2F;pages&#x2F;541&#x3F;nojs&#x3D;true\">\n         Por favor, consulte uma vers\u00e3o alternativa.\n    <\/a>\n <\/noscript>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":4,"featured_media":0,"parent":534,"menu_order":30,"comment_status":"closed","ping_status":"closed","template":"","meta":{"multilingual_post_translation":"{\"en-GB\":{\"url\":\"https:\/\/www.ipleiria.pt\/estm-en\/school\/professors\/\",\"postID\":null,\"postTitle\":\"\",\"siteID\":45,\"customURL\":true,\"languageInfo\":{\"name\":\"English (UK)\",\"locale\":\"en_GB\"}}}","page_post-custom-url":"","page_post-custom-url-target":""},"_links":{"self":[{"href":"https:\/\/www.ipleiria.pt\/estm\/wp-json\/wp\/v2\/pages\/541"}],"collection":[{"href":"https:\/\/www.ipleiria.pt\/estm\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.ipleiria.pt\/estm\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.ipleiria.pt\/estm\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ipleiria.pt\/estm\/wp-json\/wp\/v2\/comments?post=541"}],"version-history":[{"count":2,"href":"https:\/\/www.ipleiria.pt\/estm\/wp-json\/wp\/v2\/pages\/541\/revisions"}],"predecessor-version":[{"id":827,"href":"https:\/\/www.ipleiria.pt\/estm\/wp-json\/wp\/v2\/pages\/541\/revisions\/827"}],"up":[{"embeddable":true,"href":"https:\/\/www.ipleiria.pt\/estm\/wp-json\/wp\/v2\/pages\/534"}],"wp:attachment":[{"href":"https:\/\/www.ipleiria.pt\/estm\/wp-json\/wp\/v2\/media?parent=541"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}