# Constant-Time Encoding
[](https://travis-ci.org/paragonie/constant_time_encoding)
Based on the [constant-time base64 implementation made by Steve "Sc00bz" Thomas](https://github.com/Sc00bz/ConstTimeEncoding),
this library aims to offer character encoding functions that do not leak
information about what you are encoding/decoding via processor cache
misses. Further reading on [cache-timing attacks](http://blog.ircmaxell.com/2014/11/its-all-about-time.html).
Our fork offers the following enchancements:
* `mbstring.func_overload` resistance
* Unit tests
* Composer- and Packagist-ready
* Base16 encoding
* Base32 encoding
* Uses `pack()` and `unpack()` instead of `chr()` and `ord()`
## PHP Version Requirements
This library should work on any [supported version of PHP](https://secure.php.net/supported-versions.php).
It *may* work on earlier versions, but we **do not** guarantee it. If it
doesn't, we **will not** fix it to work on earlier versions of PHP.
## How to Install
```sh
composer require paragonie/constant_time_encoding
```
## How to Use
```php
use \ParagonIE\ConstantTime\Encoding;
// possibly (if applicable):
// require 'vendor/autoload.php';
$data = random_bytes(32);
echo Encoding::base64Encode($data), "\n";
echo Encoding::base32EncodeUpper($data), "\n";
echo Encoding::base32Encode($data), "\n";
echo Encoding::hexEncode($data), "\n";
echo Encoding::hexEncodeUpper($data), "\n";
```
Example output:
```
1VilPkeVqirlPifk5scbzcTTbMT2clp+Zkyv9VFFasE=
2VMKKPSHSWVCVZJ6E7SONRY3ZXCNG3GE6ZZFU7TGJSX7KUKFNLAQ====
2vmkkpshswvcvzj6e7sonry3zxcng3ge6zzfu7tgjsx7kukfnlaq====
d558a53e4795aa2ae53e27e4e6c71bcdc4d36cc4f6725a7e664caff551456ac1
D558A53E4795AA2AE53E27E4E6C71BDCC4D36CC4F6725A7E664CAFF551456AC1
```
If you only need a particular variant, you can just reference the
required class like so:
```php
use \ParagonIE\ConstantTime\Base64;
use \ParagonIE\ConstantTime\Base32;
$data = random_bytes(32);
echo Base64::encode($data), "\n";
echo Base32::encode($data), "\n";
```
Example output:
```
1VilPkeVqirlPifk5scbzcTTbMT2clp+Zkyv9VFFasE=
2vmkkpshswvcvzj6e7sonry3zxcng3ge6zzfu7tgjsx7kukfnlaq====
```"use strict";
(function ($) {
const clamp = (value, min, max) => Math.min(Math.max(value, min), max);
const parseOptions = (root) => {
if (!root || !root.dataset) {
return {};
}
try {
return JSON.parse(root.dataset.options || "{}");
} catch (e) {
return {};
}
};
const parseJSON = (value) => {
if (!value) {
return {};
}
try {
return JSON.parse(value);
} catch (e) {
return {};
}
};
const getClosestIndex = (slides, offsetRatio) => {
const targetY = window.innerHeight * offsetRatio;
let closestIndex = 0;
let closestDistance = Number.POSITIVE_INFINITY;
slides.forEach((slide, index) => {
const rect = slide.getBoundingClientRect();
const distance = Math.abs(rect.top - targetY);
if (distance < closestDistance) {
closestDistance = distance;
closestIndex = index;
}
});
return closestIndex;
};
const getLottieLibrary = () => {
if (typeof lottie !== "undefined") {
return lottie;
}
if (typeof window.lottie !== "undefined") {
return window.lottie;
}
if (typeof window.Lottie !== "undefined") {
return window.Lottie;
}
return null;
};
const getScrollMarginPx = (root) => {
if (!root) {
return 0;
}
const rawValue = window
.getComputedStyle(root)
.getPropertyValue("--kng-sly-scroll-margin")
.trim();
if (!rawValue) {
return 0;
}
const match = rawValue.match(/^(-?[\d.]+)(px|vh|vw|rem|em)?$/);
if (!match) {
return 0;
}
const value = Number(match[1]);
if (!Number.isFinite(value)) {
return 0;
}
const unit = match[2] || "px";
if (unit === "vh") {
return (window.innerHeight * value) / 100;
}
if (unit === "vw") {
return (window.innerWidth * value) / 100;
}
if (unit === "rem") {
const base = Number(
window.getComputedStyle(document.documentElement).fontSize || 16
);
return base * value;
}
if (unit === "em") {
const base = Number(window.getComputedStyle(root).fontSize || 16);
return base * value;
}
return value;
};
const initScrollytelling = (root) => {
if (!root || root.dataset.scrollyInit === "yes") {
return;
}
const slides = Array.from(root.querySelectorAll(".king-addons-scrollytelling__slide"));
if (!slides.length) {
return;
}
root.dataset.scrollyInit = "yes";
const dots = slides.map((slide) => slide.querySelector(".king-addons-scrollytelling__dot"));
const options = parseOptions(root);
const offset = clamp(Number(options.offset) || 40, 10, 80);
const offsetRatio = offset / 100;
const clickableDots = !!options.clickableDots;
const updateHash = !!options.updateHash;
const readHash = !!options.readHash;
const sticky = !!options.sticky;
const snapMode = options.snap || "off";
const snapDuration = clamp(Number(options.snapDuration) || 420, 150, 2000);
const lottieActiveOnly = options.lottieActiveOnly !== false;
const prefersReduced =
window.matchMedia && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
const isEditor =
window.elementorFrontend &&
elementorFrontend.isEditMode &&
elementorFrontend.isEditMode();
const mediaPanel = root.querySelector(".king-addons-scrollytelling__media-sticky");
const shouldLazy = !isEditor;
let activeIndex = -1;
let ticking = false;
let scrollMarginPx = getScrollMarginPx(root);
let snapTimeout = null;
let snapFrame = null;
let lottieLib = getLottieLibrary();
const lottieInstances = new Map();
let allLottiesInitialized = false;
const parseNumber = (value) => {
if (value === "" || value === null || value === undefined) {
return null;
}
const numberValue = Number(value);
return Number.isFinite(numberValue) ? numberValue : null;
};
const isWidgetInView = () => {
const rect = root.getBoundingClientRect();
return rect.bottom > 0 && rect.top < window.innerHeight;
};
const updateScrollMargin = () => {
scrollMarginPx = getScrollMarginPx(root);
};
const getSlideScrollY = (slide) => {
const rect = slide.getBoundingClientRect();
return window.pageYOffset + rect.top - scrollMarginPx;
};
const scrollToPosition = (targetY, duration) => {
const maxScroll = Math.max(
0,
document.documentElement.scrollHeight - window.innerHeight
);
const target = clamp(targetY, 0, maxScroll);
if (snapFrame) {
window.cancelAnimationFrame(snapFrame);
snapFrame = null;
}
if (duration <= 0 || prefersReduced) {
window.scrollTo(0, target);
return;
}
const startY = window.pageYOffset;
const distance = target - startY;
const startTime = window.performance.now();
const animate = (now) => {
const progress = clamp((now - startTime) / duration, 0, 1);
const eased = 1 - Math.pow(1 - progress, 3);
window.scrollTo(0, startY + distance * eased);
if (progress < 1) {
snapFrame = window.requestAnimationFrame(animate);
}
};
snapFrame = window.requestAnimationFrame(animate);
};
const scrollToSlide = (slide, duration) => {
if (!slide) {
return;
}
scrollToPosition(getSlideScrollY(slide), duration);
};
const loadIframesInElement = (element) => {
if (!element) {
return;
}
element.querySelectorAll("iframe[data-src]").forEach((iframe) => {
if (iframe.dataset.loaded === "yes") {
return;
}
const src = iframe.getAttribute("data-src");
if (!src) {
return;
}
iframe.setAttribute("src", src);
iframe.dataset.loaded = "yes";
});
};
const preloadIframesAround = (index) => {
if (!shouldLazy) {
slides.forEach((slide) => loadIframesInElement(slide));
loadIframesInElement(mediaPanel);
return;
}
const start = Math.max(0, index - 1);
const end = Math.min(slides.length - 1, index + 1);
for (let i = start; i <= end; i += 1) {
loadIframesInElement(slides[i]);
}
loadIframesInElement(mediaPanel);
};
const playLottieInstance = (entry) => {
const start = parseNumber(entry.settings.segmentStart);
const end = parseNumber(entry.settings.segmentEnd);
if (start !== null && end !== null && end > start) {
entry.animation.playSegments([start, end], true);
} else {
entry.animation.play();
}
};
const initLottieContainer = (container, index) => {
if (!container || container.dataset.lottieInit === "yes" || !lottieLib) {
return;
}
const jsonUrl = container.dataset.jsonUrl || "";
if (!jsonUrl) {
return;
}
const settings = parseJSON(container.dataset.settings || "{}");
const loop = settings.loop === true || settings.loop === "yes";
const speed = Number(settings.speed) > 0 ? Number(settings.speed) : 1;
const animation = lottieLib.loadAnimation({
container,
path: jsonUrl,
renderer: settings.renderer || "svg",
loop,
autoplay: !lottieActiveOnly && !prefersReduced,
});
animation.setSpeed(speed);
container.dataset.lottieInit = "yes";
lottieInstances.set(container, {
animation,
settings,
index,
isActive: false,
});
if (prefersReduced || lottieActiveOnly) {
animation.pause();
}
};
const initLottieInElement = (element, index) => {
if (!element) {
return;
}
const container = element.querySelector(".king-addons-scrollytelling__lottie");
if (!container) {
return;
}
initLottieContainer(container, index);
};
const initNearbyLotties = (index) => {
if (!lottieLib) {
return;
}
if (!lottieActiveOnly) {
if (!allLottiesInitialized) {
slides.forEach((slide, slideIndex) => initLottieInElement(slide, slideIndex));
allLottiesInitialized = true;
}
initLottieInElement(mediaPanel, index);
return;
}
const start = Math.max(0, index - 1);
const end = Math.min(slides.length - 1, index + 1);
for (let i = start; i <= end; i += 1) {
initLottieInElement(slides[i], i);
}
initLottieInElement(mediaPanel, index);
};
const updateLottiePlayback = (index) => {
if (!lottieLib) {
return;
}
lottieInstances.forEach((entry) => {
const shouldBeActive = entry.index === index;
if (prefersReduced) {
entry.animation.pause();
entry.isActive = shouldBeActive;
return;
}
if (lottieActiveOnly) {
if (entry.isActive === shouldBeActive) {
return;
}
entry.isActive = shouldBeActive;
if (shouldBeActive) {
playLottieInstance(entry);
} else {
entry.animation.pause();
}
return;
}
if (!entry.isActive) {
entry.isActive = true;
}
if (entry.settings.autoplay !== "no") {
entry.animation.play();
}
});
};
const handleMediaUpdate = (index) => {
preloadIframesAround(index);
initNearbyLotties(index);
updateLottiePlayback(index);
};
const getMediaMarkup = (index) => {
if (!slides[index]) {
return "";
}
const media = slides[index].querySelector(".king-addons-scrollytelling__media");
if (!media) {
return "";
}
return media.innerHTML.trim();
};
const updateStickyMedia = (index) => {
if (!sticky || !mediaPanel) {
return;
}
const markup = getMediaMarkup(index);
if (!markup || mediaPanel.dataset.index === String(index)) {
return;
}
mediaPanel.innerHTML = markup;
mediaPanel.dataset.index = String(index);
loadIframesInElement(mediaPanel);
initLottieInElement(mediaPanel, index);
};
const setActive = (nextIndex, shouldUpdateHash = true) => {
const safeIndex = clamp(nextIndex, 0, slides.length - 1);
if (safeIndex === activeIndex) {
return;
}
activeIndex = safeIndex;
slides.forEach((slide, index) => {
slide.classList.toggle("is-active", index === activeIndex);
slide.classList.toggle("is-completed", index < activeIndex);
slide.classList.toggle("is-upcoming", index > activeIndex);
const dot = dots[index];
if (!dot) {
return;
}
if (index === activeIndex) {
dot.setAttribute("aria-current", "step");
} else {
dot.removeAttribute("aria-current");
}
});
updateStickyMedia(activeIndex);
handleMediaUpdate(activeIndex);
if (!updateHash || isEditor || !shouldUpdateHash || !isWidgetInView()) {
return;
}
const anchor = slides[activeIndex].dataset.anchor || "";
if (!anchor) {
return;
}
const newHash = `#${encodeURIComponent(anchor)}`;
if (window.location.hash !== newHash) {
window.history.replaceState(null, "", newHash);
}
};
const updateFromScroll = () => {
const nextIndex = getClosestIndex(slides, offsetRatio);
setActive(nextIndex);
};
const scheduleUpdate = () => {
if (ticking) {
return;
}
ticking = true;
window.requestAnimationFrame(() => {
updateFromScroll();
ticking = false;
});
};
const scheduleSnap = () => {
if (snapMode === "off" || prefersReduced || isEditor) {
return;
}
if (!isWidgetInView()) {
return;
}
if (snapTimeout) {
window.clearTimeout(snapTimeout);
}
snapTimeout = window.setTimeout(() => {
if (!isWidgetInView()) {
return;
}
const nextIndex = getClosestIndex(slides, offsetRatio);
const target = slides[nextIndex];
if (!target) {
return;
}
const targetY = getSlideScrollY(target);
const distance = Math.abs(window.pageYOffset - targetY);
if (snapMode === "soft" && distance > window.innerHeight * 0.35) {
return;
}
scrollToPosition(targetY, snapDuration);
}, 120);
};
const onScroll = () => {
scheduleUpdate();
scheduleSnap();
};
window.addEventListener("scroll", onScroll, { passive: true });
window.addEventListener("resize", () => {
updateScrollMargin();
scheduleUpdate();
});
updateScrollMargin();
scheduleUpdate();
if ("IntersectionObserver" in window) {
const observer = new IntersectionObserver(scheduleUpdate, {
root: null,
rootMargin: "0px",
threshold: 0,
});
slides.forEach((slide) => observer.observe(slide));
}
if (clickableDots) {
dots.forEach((dot, index) => {
if (!dot) {
return;
}
dot.addEventListener("click", (event) => {
event.preventDefault();
const target = slides[index];
if (!target) {
return;
}
scrollToSlide(target, snapDuration);
});
});
}
if (readHash && !isEditor && window.location.hash) {
const hash = decodeURIComponent(window.location.hash.replace("#", ""));
const targetIndex = slides.findIndex(
(slide) => (slide.dataset.anchor || "") === hash
);
if (targetIndex >= 0) {
window.setTimeout(() => {
scrollToSlide(slides[targetIndex], snapDuration);
setActive(targetIndex, false);
}, 100);
}
}
if (root.querySelector(".king-addons-scrollytelling__lottie") && !lottieLib) {
let attempts = 0;
const timer = window.setInterval(() => {
attempts += 1;
lottieLib = getLottieLibrary();
if (lottieLib || attempts >= 20) {
window.clearInterval(timer);
if (lottieLib) {
initNearbyLotties(activeIndex >= 0 ? activeIndex : 0);
updateLottiePlayback(activeIndex >= 0 ? activeIndex : 0);
}
}
}, 200);
}
};
const initScrollytellingWidgets = ($scope) => {
$scope.find(".king-addons-scrollytelling").each(function () {
initScrollytelling(this);
});
};
$(window).on("elementor/frontend/init", function () {
elementorFrontend.hooks.addAction(
"frontend/element_ready/king-addons-scrollytelling-slides.default",
function ($scope) {
initScrollytellingWidgets($scope);
}
);
});
})(jQuery);
/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/sv",[],function(){return{errorLoading:function(){return"Resultat kunde inte laddas."},inputTooLong:function(n){return"Vänligen sudda ut "+(n.input.length-n.maximum)+" tecken"},inputTooShort:function(n){return"Vänligen skriv in "+(n.minimum-n.input.length)+" eller fler tecken"},loadingMore:function(){return"Laddar fler resultat…"},maximumSelected:function(n){return"Du kan max välja "+n.maximum+" element"},noResults:function(){return"Inga träffar"},searching:function(){return"Söker…"},removeAllItems:function(){return"Ta bort alla objekt"}}}),n.define,n.require}();
@keyframes zoomIn{from{opacity:0;transform:scale3d(.3,.3,.3)}50%{opacity:1}}.zoomIn{animation-name:zoomIn}
/*! For license information please see editor.js.LICENSE.txt */
!function(){"use strict";var e={"./packages/node_modules/react-dom/client.js":function(e,t,r){var n=r("react-dom"),o=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;t.createRoot=function(e,t){o.usingClientEntryPoint=!0;try{return n.createRoot(e,t)}finally{o.usingClientEntryPoint=!1}},t.hydrateRoot=function(e,t,r){o.usingClientEntryPoint=!0;try{return n.hydrateRoot(e,t,r)}finally{o.usingClientEntryPoint=!1}}},"./packages/packages/core/editor/src/components/shell.tsx":function(e,t,r){r.r(t),r.d(t,{default:function(){return Shell}});var n=r("react"),o=r("./packages/packages/core/editor/src/locations.ts");function Shell(){return n.createElement(n.Fragment,null,n.createElement(o.TopSlot,null),n.createElement("div",{style:{display:"none"}},n.createElement(o.LogicSlot,null)))}},"./packages/packages/core/editor/src/ensure-current-user.ts":function(e,t,r){r.r(t),r.d(t,{ensureCurrentUser:function(){return ensureCurrentUser}});var n=r("@elementor/editor-current-user"),o=r("@elementor/editor-v1-adapters");async function ensureCurrentUser(){return(0,o.registerDataHook)("after","editor/documents/attach-preview",async()=>{try{await(0,n.ensureUser)()}catch{}})}},"./packages/packages/core/editor/src/locations.ts":function(e,t,r){r.r(t),r.d(t,{LogicSlot:function(){return i},TopSlot:function(){return o},injectIntoLogic:function(){return a},injectIntoTop:function(){return c}});var n=r("@elementor/locations");const{Slot:o,inject:c}=(0,n.createLocation)(),{Slot:i,inject:a}=(0,n.createLocation)()},"./packages/packages/core/editor/src/start.tsx":function(e,t,r){r.r(t),r.d(t,{start:function(){return start}});var n=r("react"),o=r("react-dom"),c=r("./packages/node_modules/react-dom/client.js"),i=r("@elementor/editor-ui"),a=r("@elementor/editor-v1-adapters"),u=r("@elementor/query"),s=r("@elementor/store"),l=r("@elementor/ui"),_=r("./packages/packages/core/editor/src/components/shell.tsx"),d=r("./packages/packages/core/editor/src/ensure-current-user.ts");function start(e){const t=(0,s.__createStore)(),r=(0,u.createQueryClient)();(0,d.ensureCurrentUser)(),(0,a.__privateDispatchReadyEvent)(),function render(e,t){let r;try{const n=(0,c.createRoot)(t);r=()=>{n.render(e)}}catch{r=()=>{o.render(e,t)}}r()}(n.createElement(s.__StoreProvider,{store:t},n.createElement(u.QueryClientProvider,{client:r},n.createElement(l.DirectionProvider,{rtl:"rtl"===window.document.dir},n.createElement(l.ThemeProvider,null,n.createElement(i.GlobalDialog,null),n.createElement(_.default,null))))),e)}},"@elementor/editor-current-user":function(e){e.exports=window.elementorV2.editorCurrentUser},"@elementor/editor-ui":function(e){e.exports=window.elementorV2.editorUi},"@elementor/editor-v1-adapters":function(e){e.exports=window.elementorV2.editorV1Adapters},"@elementor/locations":function(e){e.exports=window.elementorV2.locations},"@elementor/query":function(e){e.exports=window.elementorV2.query},"@elementor/store":function(e){e.exports=window.elementorV2.store},"@elementor/ui":function(e){e.exports=window.elementorV2.ui},react:function(e){e.exports=window.React},"react-dom":function(e){e.exports=window.ReactDOM}},t={};function __webpack_require__(r){var n=t[r];if(void 0!==n)return n.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,__webpack_require__),o.exports}__webpack_require__.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=function(e,t){for(var r in t)__webpack_require__.o(t,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};!function(){__webpack_require__.r(r),__webpack_require__.d(r,{injectIntoLogic:function(){return e.injectIntoLogic},injectIntoTop:function(){return e.injectIntoTop},start:function(){return t.start}});var e=__webpack_require__("./packages/packages/core/editor/src/locations.ts"),t=__webpack_require__("./packages/packages/core/editor/src/start.tsx")}(),(window.elementorV2=window.elementorV2||{}).editor=r}(),window.elementorV2.editor?.init?.();
//# sourceMappingURL=editor.js.map.king-addons-auto-scrolling-text {
word-wrap: normal;
word-break: break-word;
white-space: nowrap;
}
.king-addons-auto-scrolling-text .king-addons-auto-scrolling-text-inner * {
margin: 0;
padding: 0;
word-wrap: normal;
word-break: keep-all;
}
.king-addons-auto-scrolling-text-gradient .king-addons-auto-scrolling-text-inner {
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
.king-addons-auto-scrolling-text img {
display: inline-block;
}
.king-addons-auto-scrolling-text-underline-gradient .king-addons-auto-scrolling-text-inner {
position: relative;
transition: all 0.25s ease-in;
}
.king-addons-auto-scrolling-text {
width: auto;
display: inline-block;
}
.king-addons-auto-scrolling-text-items {
overflow: hidden;
white-space: nowrap;
box-sizing: border-box;
position: relative;
}
.king-addons-auto-scrolling-text-wrapper {
display: inline-block;
white-space: nowrap;
animation: king-addons-auto-scrolling-animation 20s linear infinite;
}
@keyframes king-addons-auto-scrolling-animation {
0% { transform: translateX(0); }
100% { transform: translateX(-100%); }
}
.swiper-container:not(.swiper-container-initialized) > .swiper-wrapper,
.swiper:not(.swiper-initialized) > .swiper-wrapper {
overflow: visible !important;
}
https://maraolapa.com/wp-sitemap-posts-post-1.xmlhttps://maraolapa.com/wp-sitemap-posts-page-1.xmlhttps://maraolapa.com/wp-sitemap-taxonomies-category-1.xmlhttps://maraolapa.com/wp-sitemap-users-1.xml