{"id":171,"date":"2025-06-23T19:49:01","date_gmt":"2025-06-23T22:49:01","guid":{"rendered":"https:\/\/tools.hfactory.com.br\/?page_id=171"},"modified":"2025-07-01T11:45:04","modified_gmt":"2025-07-01T14:45:04","slug":"area-de-transferencia","status":"publish","type":"page","link":"https:\/\/tools.hfactory.com.br\/index.php\/area-de-transferencia\/","title":{"rendered":"\u00c1rea de Transfer\u00eancia"},"content":{"rendered":"\n<template id=\"hf-select\"><select @input=\"emitChange\"><option v-for=\"(option, index) of options\" :key=\"index\" :value=\"option.value\">{{ option.label }}<\/option><\/select><\/template><script type=\"text\/javascript\">Vue.component('hf-select', {\n    template: document.querySelector('template#hf-select').innerHTML,\n    props: ['options', 'value'],\n    methods: {\n        emitChange($event) {\n            this.$emit('input', $event.target.value);\n        },\n    },\n});\n<\/script><template id=\"hf-tooltip\"><hf-tooltip-ghost><hf-tooltip-wrapper @click=\"show\" @mouseover=\"show\" :class=\"position\"><hf-icon ref=\"icon\">i<\/hf-icon><hf-self-tooltip ref=\"tooltip\" :style=\"style\" :class=\"{ show: canShow }\">{{ information }}<hf-arrow ref=\"arrow\"><\/hf-arrow><\/hf-self-tooltip><\/hf-tooltip-wrapper><\/hf-tooltip-ghost><\/template><script type=\"text\/javascript\">Vue.component('hf-tooltip', {\n    template: document.querySelector('template#hf-tooltip').innerHTML,\n    props: ['information'],\n    data() {\n        return {\n            xIcon: null, \n            alignTimes: 0,\n            canShow: false,\n            currentTarget: null,\n            position: 'bottom',\n            style: { },\n        };\n    },\n    methods: {\n        eventHide(_event) {\n            if (_event.composedPath().includes(this.currentTarget)) {\n                return;\n            }\n\n            this.position = 'bottom';\n            this.canShow = false;\n            window.onclick = null;\n            window.onmouseover = null;\n            this.currentTarget = null;\n        },\n        isTinyScreen() {\n            return window.innerWidth < 768;\n        },\n        setPosition(target) {\n            const rect = target.getBoundingClientRect();\n            const isBigger = window.innerHeight > (rect.y + rect.height);\n            \n            this.position = (isBigger) ? 'bottom' : 'top'; \n        },\n        getxIcon() {\n            if (this.xIcon !== null) {\n                return this.xIcon;\n            }\n\n            this.xIcon = this.$refs.icon.getBoundingClientRect().x;\n            \n            return this.xIcon;\n        },\n        getxForAlign(target, sub) {\n            const rect = target.getBoundingClientRect();\n            \n            return (this.getxIcon() - rect.x) - sub;\n        },\n        alignX(target, sub) {\n            if (this.alignTimes === 2) {\n                return;\n            }\n\n            target.style.marginLeft = this.getxForAlign(target, sub) + 'px';\n            this.alignTimes++;\n        },\n        show($event) {\n            if (this.canShow) {\n                return;\n            }\n\n            const vue = this;\n            const data = { };\n\n            \/\/- (vue.isTinyScreen()) ? \n            data.arrow = vue.$refs.arrow;\n            data.tooltip = vue.$refs.tooltip;\n\n            data.tooltip.style.visibility = 'hidden';\n            vue.canShow = true;\n            vue.currentTarget = $event.target;\n                            \n            setTimeout(function() {\n                vue.setPosition(data.tooltip);\n                vue.alignX(data.tooltip, 25);\n                vue.alignX(data.arrow, -2);\n                data.tooltip.style.visibility = 'visible';\n\n                window.onclick = vue.eventHide;\n                window.onmouseover = vue.eventHide;\n            });\n        }\n    },\n});\n\n<\/script><style>hf-tooltip-ghost {\n    display: inline-block; \n    height: 0;\n    width: 0;\n}\n\nhf-tooltip-wrapper {\n    cursor: default;\n    margin-top: 5px;\n}\n\nhf-tooltip-wrapper,\nhf-tooltip-wrapper hf-icon,\nhf-tooltip-wrapper hf-self-tooltip hf-arrow,\nhf-tooltip-wrapper hf-self-tooltip.show {\n    display: inline-block;\n    vertical-align: top;\n    z-index: 3;\n}\n\nhf-tooltip-wrapper hf-icon {\n    font-style: normal;\n    border: 1px solid;\n    border-radius: 15px;\n    padding: 2px 5px 0px;\n    line-height: 11px;\n    font-size: 10px;\n    font-weight: 900;\n    position: absolute;\n    margin-left: 5px;\n}\n\nhf-tooltip-wrapper hf-self-tooltip {\n    margin-top: 25px;\n    width: max-content;\n    position: absolute;\n    left: 0;\n    right: 0;\n    display: none;\n    padding: 4px 12px;\n    max-width: 300px;\n    color: #fff;\n    border-radius: 4px;\n    white-space: break-spaces;\n}\n\nhf-tooltip-wrapper.top hf-self-tooltip.show {\n    top: calc(-100% - 23px);\n    bottom: initial;\n}\n\nhf-tooltip-wrapper hf-self-tooltip hf-arrow,\nhf-tooltip-wrapper hf-self-tooltip { background: #000; }\n\nhf-tooltip-wrapper hf-self-tooltip hf-arrow {\n    display: block;\n    position: absolute;\n    left: 0;\n    padding: 4px;\n    transform: rotate(45deg);\n    font-size: 0;\n}\n\nhf-tooltip-wrapper.bottom hf-self-tooltip hf-arrow {\n    top: initial;\n    bottom: calc(100% - 4px);\n}\n\n@media screen and (min-width: 100px) and (max-width: 768px) {\n    hf-tooltip-wrapper hf-self-tooltip { text-align: center; }\n    hf-tooltip-wrapper hf-self-tooltip.show { position: fixed; }\n}\n<\/style><template id=\"hf-input\"><hf-input-wrapper :class=\"name\"><label v-if=\"!isCheckField()\" :for=\"name\">{{ label }}<\/label><hf-tooltip v-if=\"hasTooltip()\" :information=\"tooltip\"><\/hf-tooltip><span class=\"field\" v-if=\"isExternal()\"><slot><\/slot><\/span><span class=\"field\" v-if=\"!isExternal() &amp;&amp; isTextArea()\"><textarea v-if=\"isFree()\" :value=\"value\" @input=\"emitChange\" :id=\"name\" :name=\"name\"><\/textarea><textarea v-if=\"hasCustomMask()\" :value=\"value\" @input=\"emitChange\" :id=\"name\" :name=\"name\" @keydown=\"customMaskApply\" @keyup=\"customMaskApply\"><\/textarea><\/span><span class=\"field\" v-if=\"!isExternal() &amp;&amp; isSelect()\"><select :value=\"value\" @input=\"emitChange\"><option v-for=\"(option, index) of options\" :key=\"index\" :value=\"option.value\">{{ option.label }}<\/option><\/select><\/span><span class=\"field\" v-if=\"!isExternal() &amp;&amp; !isSelect() &amp;&amp; !isTextArea()\"><span class=\"badge\" v-if=\"hasBadge()\">{{ badge }}<\/span><input v-if=\"isFree()\" :value=\"value\" @input=\"emitChange\" :type=\"type\" :id=\"name\" :name=\"name\" \/><input v-if=\"hasCustomMask()\" :value=\"value\" @input=\"emitChange\" @keydown=\"customMaskApply\" @keyup=\"customMaskApply\" :type=\"type\" :id=\"name\" :name=\"name\" \/><input v-if=\"isMoney()\" :value=\"value\" v-money=\"money\" @input=\"emitChange\" :type=\"type\" :id=\"name\" :name=\"name\" \/><input v-if=\"hasMask()\" :value=\"value\" v-mask=\"mask\" @input=\"emitChange\" :type=\"type\" :id=\"name\" :name=\"name\" \/><\/span><label v-if=\"isCheckField()\" :for=\"name\">{{ label }}<\/label><\/hf-input-wrapper><\/template><script type=\"text\/javascript\">Vue.component('hf-input', {\n    template: document.querySelector('template#hf-input').innerHTML,\n    props: ['name', 'type', 'label', 'badge', 'tooltip', 'money', 'mask', 'custom-mask', 'value', 'options'],\n    data() {\n        return {};\n    },\n    methods: {\n        isExternal() {\n            return this.type === 'external';\n        },\n        isCheckField() {\n            return this.type === 'checkbox' || this.type === 'radio';\n        },\n        isTextArea() {\n            return this.type === 'textarea';\n        },\n        isSelect() {\n            return this.type === 'select';\n        },\n        hasTooltip() {\n            return this.tooltip !== undefined;\n        },\n        hasBadge() {\n            return this.badge !== undefined;\n        },\n        isMoney() {\n            return this.money !== undefined;\n        },\n        hasMask() {\n            return this.mask !== undefined;\n        },\n        hasCustomMask() {\n            return this.customMask !== undefined;\n        },\n        customMaskApply(aEvent) {\n            if (['backspace', 'delete'].indexOf(aEvent.code.toLowerCase()) > -1) {\n                return;\n            }\n\n            const mask = String('[^%s]+').replace('%s', this.customMask);\n            const regex = new RegExp(mask, 'g');\n\n            return this.value = this.value.replace(regex, '');\n        },\n        isFree() {\n            return this.money === undefined && this.mask === undefined && this.customMask === undefined;\n        },\n        emitChange($event) {\n            const self = this;\n\n            setTimeout(function() {\n                if ($event.target === undefined || $event.target === null) {\n                    return;\n                }\n\n                self.$emit('input', $event.target.value);\n            });\n        },\n    },\n});\n<\/script><style>hf-input-wrapper {\n    display: block;\n    margin-top: 15px;\n}\n\nhf-input-wrapper:nth-of-type(1) { margin-top: 0; }\nhf-input-wrapper span.field { display: table; }\n\nhf-input-wrapper span.field,\nhf-input-wrapper input { width: 100%; }\n\nhf-input-wrapper span.badge {\n    color: #FFFFFF;\n    padding: 18px 14px;\n    background-color: #4DB2EC;\n    display: table-cell;\n    width: 1px;\n    border: 1px solid #CCCCCC;\n    border-right: 0;\n    border-radius: 4px;\n    border-top-right-radius: 0;\n    border-bottom-right-radius: 0;\n}\n\nhf-input-wrapper span.badge + input {\n    border-top-left-radius: 0;\n    border-bottom-left-radius: 0;\n}\n<\/style><div id=\"transfer-area\" class=\"main-wrapper\"><div id=\"saves\" v-if=\"hasSession()\"><div class=\"header\"><h2>Sua \u00e1rea de transfer\u00eancia<\/h2><span>Sess\u00e3o:<strong>{{ transferData.key }}<\/strong><a @click=\"logout()\">Sair<\/a><\/span><\/div><table v-if=\"hasSaves()\"><thead><tr><th>Nome<\/th><th>Tipo<\/th><th>Ver\/Baixar<\/th><th>Descri\u00e7\u00e3o<\/th><th>A\u00e7\u00f5es<\/th><\/tr><\/thead><tbody><tr v-for=\"(save, index) of saves\" :key=\"index\"><td>{{ getSafe(save.meta.name) }}<\/td><td>{{ getSafe(save.meta.type) }}<\/td><td><a @click=\"openLinks(save.meta)\" href=\"#\">Ver\/Baixar<\/a><\/td><td>{{ getSafe(save.meta.description) }}<\/td><td><span v-if=\"false\" @click=\"openToUpdate(save)\">Editar<\/span><span @click=\"showRemove(save)\">Excluir<\/span><\/td><\/tr><\/tbody><\/table><div class=\"lightbox\" v-if=\"openModal\"><div class=\"modal\"><a class=\"close\" @click=\"openCloseModal(true)\" href=\"#\">Fechar<\/a><div v-if=\"saveIsText()\"><textarea :value=\"savedText\" disabled=\"disabled\"><\/textarea><\/div><div v-if=\"hasLinks()\"><ul><li v-for=\"(link, index) of links\" :key=\"index\"><a :href=\"getFileLink(link.name)\">{{ link.name }}<\/a><\/li><\/ul><\/div><\/div><\/div><span v-if=\"!hasSaves()\">Voc\u00ea n\u00e3o possui salvamentos<\/span><\/div><div id=\"access\" v-if=\"!hasSession()\"><a v-if=\"isView(&#039;default&#039;)\" @click=\"changeView(&#039;add-pass&#039;)\">Criar uma senha<\/a><a v-if=\"isView(&#039;default&#039;)\" @click=\"changeView(&#039;auth&#039;)\">Autentique uma sess\u00e3o<\/a><div id=\"autenticate\"><h3 v-if=\"!isView(&#039;default&#039;)\">{{ getAuthTitle() }}<\/h3><hf-input v-if=\"isView(&#039;auth&#039;)\" name=\"session\" label=\"ID\" type=\"text\" v-model=\"session.key\" tooltip=\"ID da sess\u00e3o\" custom-mask=\"0-9\"><\/hf-input><hf-input v-if=\"!isView(&#039;default&#039;)\" name=\"password\" label=\"Senha\" type=\"external\" tooltip=\"Senha da sess\u00e3o\"><input type=\"password\" v-model=\"session.password\" @keyup=\"keyUpPassword($event)\" \/><\/hf-input><div class=\"buttons\"><button class=\"secondary\" v-if=\"!isView(&#039;default&#039;)\" @click=\"changeView(&#039;default&#039;)\">Cancelar<\/button><button class=\"primary\" v-if=\"isView(&#039;add-pass&#039;)\" @click=\"addPassword()\">Criar Senha<\/button><button class=\"primary\" v-if=\"isView(&#039;auth&#039;)\" @click=\"login()\">Autenticar Sess\u00e3o<\/button><\/div><\/div><\/div><div id=\"input\" v-if=\"hasSession()\"><hf-input name=\"link\" label=\"Link\" type=\"external\" tooltip=\"Link\"><input type=\"radio\" :checked=\"isMode(&#039;link&#039;)\" id=\"link\" name=\"type\" @click=\"changeMode(&#039;link&#039;)\" \/><\/hf-input><hf-input name=\"text\" label=\"Texto Multilinha\" type=\"external\" tooltip=\"Texto Multilinha\"><input type=\"radio\" :checked=\"isMode(&#039;text&#039;)\" id=\"text\" name=\"type\" @click=\"changeMode(&#039;text&#039;)\" \/><\/hf-input><hf-input name=\"files\" label=\"Arquivos\" type=\"external\" tooltip=\"Arquivos\"><input type=\"radio\" :checked=\"isMode(&#039;file&#039;)\" id=\"files\" name=\"type\" @click=\"changeMode(&#039;file&#039;)\" \/><\/hf-input><hf-input label=\"Nome do salvameto\" type=\"text\" v-model=\"input.name\" tooltip=\"Nome do salvameto\" custom-mask=\"a-zA-Z0-9\\-_. \"><\/hf-input><hf-input label=\"Descri\u00e7\u00e3o do salvameto (Opcional)\" type=\"textarea\" v-model=\"input.description\" tooltip=\"Descri\u00e7\u00e3o do salvameto\"><\/hf-input><hf-input v-if=\"isMode(&#039;link&#039;)\" label=\"Endere\u00e7o do link\" type=\"text\" v-model=\"input.value\" tooltip=\"Endere\u00e7o do link\" custom-mask=\"a-zA-Z0-9\\\/:.\\-+_@\"><\/hf-input><hf-input v-if=\"isMode(&#039;text&#039;)\" label=\"Texto\" type=\"textarea\" v-model=\"input.value\" tooltip=\"Texto\"><\/hf-input><hf-input v-if=\"isMode(&#039;file&#039;)\" label=\"Arquivos\" type=\"external\" tooltip=\"Arquivos\"><input ref=\"files\" @input=\"updateFiles($event)\" multiple=\"multiple\" type=\"file\" name=\"files\" \/><\/hf-input><div class=\"buttons\"><button class=\"secondary\" @click=\"clear()\">Limpar<\/button><button class=\"primary\" @click=\"save()\">Salvar<\/button><\/div><\/div><\/div><style>hf-input-wrapper.link,\nhf-input-wrapper.text,\nhf-input-wrapper.files { display: inline-block; }\n\nhf-input-wrapper.link span.field,\nhf-input-wrapper.text span.field,\nhf-input-wrapper.files span.field {\n    display: inline-block;\n    width: 70px;\n    margin-right: 50px;\n}\n<\/style><script>const transferArea = new VueJs({\n    el: 'div#transfer-area',\n    data: {\n        TRANSFER_KEY: 'transfer-area-data',\n        transferData: {},\n        mode: 'link',\n        input: {},\n        saves: [],\n        savedText: '',\n        links: [],\n        openModal: false,\n        editing: null,\n        view: 'default',\n        session: {\n            key: '',\n            password: '',\n        },\n    },\n    methods: {\n        isView(view) {\n            return this.view === view;\n        },\n        changeView(view) {\n            this.view = view;\n        },\n        storeSession(data) {\n            localStorage.setItem(this.TRANSFER_KEY, JSON.stringify(data));\n            this.transferData = data;\n        },\n        getAuthTitle() {\n            return this.isView('auth') ? 'Autenticar sess\u00e3o existente' : 'Crie uma senha de acesso';\n        },\n        addPassword() {\n            if (\n                !this.validator(this.session.password, 'Senha.nonEmpty') ||\n                !this.validator(this.session.password, 'Senha.minLength.3')\n            ) {\n                alert(this.$validationErrors[0]);\n\n                return ;\n            }\n\n            const self = this;\n            const url = self.getApiUrl('\/session');\n\n            axios.post(url, { password: self.session.password })\n                .then(function(response) {\n                    self.storeSession(response.data);\n                    self.getData();\n                });\n        },\n        login() {\n            if (\n                !this.validator(this.session.key, 'ID.nonEmpty') ||\n                !this.validator(this.session.key, 'ID.minLength.9') ||\n                !this.validator(this.session.password, 'Senha.nonEmpty') ||\n                !this.validator(this.session.password, 'Senha.minLength.3')\n            ) {\n                alert(this.$validationErrors[0]);\n\n                return ;\n            }\n\n            const self = this;\n            const url = this.getApiUrl('\/auth');\n\n            axios.post(url, { key: this.session.key, password: this.session.password })\n                .then(function(response) {\n                    self.storeSession(response.data);\n                    self.getData();\n                });\n        },\n        keyUpPassword(aEvent) {\n            if (aEvent.code.toLowerCase() !== 'enter') {\n                return;\n            }\n\n            if (!this.isView('auth')) {\n                this.addPassword();\n\n                return;\n            }\n\n            this.login();\n        },\n        logout() {\n            this.storeSession({});\n            this.clearSavedText();\n            this.closeLinks();\n            this.view = 'default';\n            this.session.key = '';\n            this.session.password = '';\n\n            return;\n\n            const url = this.getApiUrl('\/auth', { key: this.session.key });\n\n            axios.delete(url)\n                .then(function(response) {\n                    console.log(response)\n                });\n        },\n        getSafe(value) {\n            return value;\n        },\n        getNewEmpty() {\n            return {\n                type: 'link',\n                name: '',\n                description: '',\n                value: '',\n                files: null,\n            };\n        },\n        clear(endpoint) {\n            this.input = this.getNewEmpty();\n        },\n        isMode(mode) {\n            return this.mode === mode;\n        },\n        changeMode(mode) {\n            this.mode = mode;\n            this.input.type = mode;\n        },\n        hasSession() {\n            return Object.keys(this.transferData).length > 0;\n        },\n        hasSaves() {\n            return this.saves.length > 0;\n        },\n        saveIsText() {\n            return this.savedText !== '';\n        },\n        hasLinks() {\n            return this.links.length > 0;\n        },\n        openCloseModal(close) {\n            if (close === undefined) {\n                this.openModal = true;\n\n                return;\n            }\n\n            this.openModal = false;\n            this.closeLinks();\n            this.clearSavedText();\n        },\n        openLinks(save) {\n            const isArray = (save.files instanceof Array);\n\n            if (save.type === 'text') {\n                this.savedText = save.value;\n                this.openCloseModal();\n\n                return;\n            }\n\n            if (isArray && save.files.length > 0) {\n                this.links = save.files;\n                this.openCloseModal();\n\n                return;\n            }\n\n            window.open(save.value);\n        },\n        closeLinks() {\n            this.links = [];\n        },\n        clearSavedText() {\n            this.savedText = '';\n        },\n        getFileLink(filename) {\n            return this.getApiUrl('\/get-file', { filename });\n        },\n        updateFiles() {\n            this.input.files = this.$refs.files.files;\n        },\n        getApiUrl(endpoint, data) {\n            const params = {};\n            data = (data === undefined) ? {} : data;\n            params['transfer-key'] = this.transferData.key;\n            params['transfer-token'] = this.transferData.token;\n            const tail = String('?%s').replace('%s', jQuery.param(Object.assign(params, data)));\n\n            return '\/wp-json\/hfactory\/transfer\/v1' + endpoint + tail;\n        },\n        normalize(data) {\n            Object.keys(data).forEach(function(key) {\n                const meta = data[key].meta;\n\n                if (typeof(meta.files) === 'object' && meta.files !== null) {\n                    meta.files = meta.files.files;\n\n                    return;\n                }\n\n                if ([undefined, null, 'null'].indexOf(meta.files) === -1) {\n                    meta.files = JSON.parse(meta.files).files;\n                }\n            });\n        },\n        getData(data) {\n            const self = this;\n            const url = self.getApiUrl('\/data');\n\n            axios.get(url)\n                .then(function(response) {\n                    self.normalize(response.data);\n                    self.saves = response.data;\n                });\n        },\n        validations() {\n            const labels = {\n                link: 'Endere\u00e7o do link',\n                text: 'Texto',\n                file: 'Arquivos',\n            };\n\n            const type = this.input.type;\n            const key = (type !== 'file') ? 'value' : 'files';\n            const rules = (type !== 'file') ? 'nonEmpty' : 'nonEmptyList';\n            const ruleList = [labels[type], rules].join('.');\n\n            return (\n                this.validator(this.input.name, 'Nome do salvamento.nonEmpty')\n                && this.validator(this.input[key], ruleList)\n                && ((type !== 'file') ? this.validator(this.input.value, [labels[type], 'minLength.3'].join('.')) : true)\n            );\n        },\n        save(id) {\n            const self = this;\n\n            if (!self.validations()) {\n                self.newSwal({\n                    title: self.$validationErrors[0],\n                    showCancelButton: false,\n                });\n\n                return;\n            }\n\n            id = (id === undefined) ? 0 : id;\n            const url = this.getApiUrl('\/data', { 'ID': id });\n            const input = this.input;\n\n            return axios.post(\n                url,\n                this.input,\n                { headers: { 'Content-Type': 'multipart\/form-data' } })\n                .then(function(response) {\n                    const data = response.data;\n                    const meta = Object.assign({}, self.input, { files: data.files });\n                    const input = Object.assign({ meta }, { ID: data.ID });\n\n                    if (input.ID === undefined) {\n                        return;\n                    }\n\n                    self.newSwal({\n                        title: String('O registro <strong>%s<\/strong> foi criado!').replace('%s', input.meta.name),\n                        confirmButtonText: 'Ok',\n                        showCancelButton: false,\n                    })\n                        .then(function(confirm) {\n                            self.normalize([input]);\n                            self.addToList(input);\n                            self.clear();\n                        });\n                });\n        },\n        addToList(input) {\n            this.saves = [].concat([input], this.saves);\n        },\n        openToUpdate(save) {\n            const type = save.meta.type;\n\n            this.editing = save;\n            this.mode = type;\n            this.input.type = type;\n            this.input.name = save.meta.name;\n            this.input.description = save.meta.description;\n            this.input.value = save.meta.value;\n            this.input.files = save.meta.files;\n        },\n        update(save) {\n            this.save(save.ID);\n        },\n        newSwal(data) {\n            const options = {\n                title: 'Question?',\n                icon: 'info',\n                showCloseButton: true,\n                showCancelButton: true,\n                focusConfirm: true,\n                confirmButtonText: 'Ok',\n                cancelButtonText: 'Cancelar',\n                reverseButtons: true,\n            };\n\n            return Swal.fire(Object.assign(options, data));\n        },\n        showRemove(save) {\n            const self = this;\n\n            self.newSwal({\n                title: String('Deseja mesmo excluir o salvamento <strong>%s<\/strong>?').replace('%s', save.meta.name),\n                confirmButtonText: 'Excluir',\n                showCancelButton: true,\n            })\n                .then(function(confirm) {\n                    if (!confirm.isConfirmed) {\n                        return;\n                    }\n\n                    self.remove(save);\n                });\n        },\n        remove(save) {\n            const self = this;\n            const url = self.getApiUrl('\/data', { 'ID': save.ID });\n\n            return axios.delete(url)\n                .then(function(response) {\n                    if (response.data.ID === undefined) {\n                        alert('Error ao excluir!');\n\n                        return;\n                    }\n\n                    const saves = self.saves;\n                    const pos = saves.indexOf(save);\n\n                    self.saves = [].concat(\n                        saves.slice(0, pos),\n                        saves.slice(pos + 1),\n                    );\n                });\n        },\n    },\n    mounted() {\n        const self = this;\n\n        axios.interceptors.response.use(function(response) { return response }, function (error) {\n            if (\n                error.response.status !== 401 &&\n                error.response.statusText !== \"Unauthorized\"\n            ) {\n                return;\n            }\n\n            self.storeSession({});\n        });\n\n        const transferData = localStorage.getItem(this.TRANSFER_KEY);\n\n        this.transferData = (transferData === null) ? {} : JSON.parse(transferData);\n        this.clear();\n        this.getData();\n\n    }\n});\n<\/script>\n\n\n\n<style>span.alert,\ndiv.alert {\n    padding: 15px;\n    border: 1px solid transparent;\n    border-radius: 4px;\n    display: block;\n}\n\nspan.alert.danger,\ndiv.alert.danger {\n    color: #A94442;\n    background-color: #F2DEDE;\n    border-color: #EBCCD1;\n}\n\nbutton,\n.button,\ninput[type=\"button\"],\ninput[type=\"reset\"],\ninput[type=\"submit\"] {\n    border: none;\n    cursor: pointer;\n    padding: 10px 20px;\n    font-size: 18px;\n    height: 50px;\n    outline: none;\n}\n\nbutton.primary,\n.button.primary,\ninput[type=\"button\"].primary,\ninput[type=\"reset\"].primary,\ninput[type=\"submit\"].primary {\n    background-color: #052442;\n    color: #FFFFFF;\n}\n\nbutton.secondary,\n.button.secondary,\ninput[type=\"button\"].secondary,\ninput[type=\"reset\"].secondary,\ninput[type=\"submit\"].secondary {\n    border: 1px solid #D7D3D3;\n    background-color: #FFFFFF;\n}\n\nbutton.danger,\n.button.danger,\ninput[type=\"button\"].danger,\ninput[type=\"reset\"].danger,\ninput[type=\"submit\"].danger {\n    background-color: red;\n    color: #FFFFFF;\n}\n\nbutton.success,\n.button.success,\ninput[type=\"button\"].success,\ninput[type=\"reset\"].success,\ninput[type=\"submit\"].success {\n    background-color: green;\n    color: #FFFFFF;\n}\n\ndiv.buttons { margin: 30px 0; }\ndiv.buttons button.secondary { margin-right: 10px; }\n\ninput[type=\"checkbox\"] {\n    width: 20px;\n    height: 20px;\n}\n.border1 { border: 1px solid #000000; }\n\ndiv.default { font-family: system-ui; }\n\nfont-roboto { font-family: Roboto; }\n\n\ninput[type=\"text\"],\ninput[type=\"email\"],\ninput[type=\"password\"],\ninput[type=\"number\"],\ninput[type=\"date\"],\ninput[type=\"week\"],\ninput[type=\"month\"],\nselect {\n    color: #000000;\n    background: #F2F2F2;\n    font-size: 18px;\n    height: 50px;\n    width: 100%;\n    padding: 10px;\n    border: none;\n    border-radius: 5px;\n    outline: none;\n    line-height: 21px;\n}\n\nlabel {\n    color: #57B3EE;\n    font-size: 16px;\n    font-weight: 900;\n}\n\ninput + label { color: #000000; }\n\nselect {\n    border: 1px solid #D1D1D1;\n    padding: 5px;\n}\n\ndiv.line {  }\n\na:hover {  }\n\nbody {\n    min-width: 360px;\n    margin: 0;\n    padding: 0;\n}\n\ninput { outline: none; }\na { text-decoration: none; }\n\ntable th,\ntable td {\n    white-space: nowrap;\n}\n\ndiv#result {\n    overflow-x: auto;\n    width: 100%;\n}\n\ndiv#result table th,\ndiv#result table td { padding: 14px 18px; }\n\nh1 {\n    font-size: 36px;\n    margin: 20px auto 10px;\n    text-align: center;\n}\n\nh2 { font-size: 30px; }\n:root {\n    --padding-default: 30px 41px 36px;\n}\n\ndiv.main-wrapper {\n    padding: var(--padding-default);\n    box-shadow: 0 0 20px 0 rgb(0 0 0\/10%),0 5px 5px 0 rgb(0 0 0\/10%);\n}\n\ndiv.lightbox {\n    position: fixed;\n    background: #00000059;\n    height: 100%;\n    width: 100%;\n    top: 0;\n    left: 0;\n}\n\ndiv.modal {\n    width: 40%;\n    height: 30vh;\n    background: #FFF;\n    padding: var(--padding-default);\n    border-radius: 4px;\n    margin: 20vh auto 0;\n}\n\ndiv.modal a.close {\n    float: right;\n    display: block;\n    height: 40px;\n    width: 40px;\n    background-color: #000;\n    font-size: 0;\n    border-radius: 4px;\n}\n<\/style>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-171","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/tools.hfactory.com.br\/index.php\/wp-json\/wp\/v2\/pages\/171","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tools.hfactory.com.br\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/tools.hfactory.com.br\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/tools.hfactory.com.br\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tools.hfactory.com.br\/index.php\/wp-json\/wp\/v2\/comments?post=171"}],"version-history":[{"count":3,"href":"https:\/\/tools.hfactory.com.br\/index.php\/wp-json\/wp\/v2\/pages\/171\/revisions"}],"predecessor-version":[{"id":228,"href":"https:\/\/tools.hfactory.com.br\/index.php\/wp-json\/wp\/v2\/pages\/171\/revisions\/228"}],"wp:attachment":[{"href":"https:\/\/tools.hfactory.com.br\/index.php\/wp-json\/wp\/v2\/media?parent=171"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}