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AO,QACvCU,EAAuBC,KAAKC,IAAI,EAAGpB,EAAeC,EAAc,GAChEoB,EAAI,aACFpB,EAAc,EAAIiB,KAAwBjB,EAAc,cACxDG,EAAgBH,EAAc,EAAIiB,cAClCA,KAAwBA,WAA8Bd,EAAgBH,EAAc,KACtFA,EAAc,EAAIiB,cAEhBZ,EAAiBL,EAAc,EAAIiB,cACnCA,KAAwBA,WAC1Bd,EAAgBH,EAAc,EAAIiB,KAChCZ,EAAiBL,EAAc,cAC/BA,EAAc,EAAIiB,cAClBA,KAAwBA,WAA8BjB,EAAc,KACtEK,EAAiBL,EAAc,EAAIiB,cAEjCjB,EAAc,EAAIiB,cAClBA,KAAwBA,WAA8BjB,EAAc,EAAIiB,KAC1EjB,EAAc,mBAIpBgB,EAAKN,aAAa,IAAKU,GACvBJ,EAAKN,aAAa,OAAQ,QAC1BM,EAAKN,aAAa,SAAU,uBAC5BM,EAAKN,aAAa,eAAgBV,GAClCgB,EAAKN,aAAa,mBAAoBZ,GACtCkB,EAAKN,aAAa,kBAAmB,SAErCF,EAAIa,YAAYL,GAEhBrB,EAAQ0B,YAAYb,EACtB,CAmCIc,CAAmB5B,EAAO,GAC1B,IAGW6B,QAAQrD,SAASsD,K","sources":["webpack://silverstripe-base/./themes/app/src/elements/testimonials.js"],"sourcesContent":["import Swiper from \"swiper\";\nimport { A11y, Autoplay, Pagination } from \"swiper/modules\";\nimport \"@styles/components/slider.css\";\n\nfunction createDashedBorder(element, options = {}) {\n if (element.querySelector(\".svg-border\")) {\n element.querySelector(\".svg-border\").remove();\n }\n\n const { dashArray = \"20 5\", cornerRadius = 30, strokeWidth = 3 } = options;\n\n const rect = element.getBoundingClientRect();\n\n const adjustedWidth = rect.width + strokeWidth;\n const adjustedHeight = rect.height + strokeWidth;\n\n const xmlns = \"http://www.w3.org/2000/svg\";\n\n const svg = document.createElementNS(xmlns, \"svg\");\n svg.setAttribute(\"class\", \"svg-border\");\n svg.setAttribute(\"width\", adjustedWidth);\n svg.setAttribute(\"height\", adjustedHeight);\n svg.setAttribute(\"viewBox\", `0 0 ${adjustedWidth} ${adjustedHeight}`);\n svg.style.position = \"absolute\";\n svg.style.top = `-${strokeWidth / 2}px`;\n svg.style.left = `-${strokeWidth / 2}px`;\n svg.style.width = `calc(100% + ${strokeWidth}px)`;\n svg.style.height = `calc(100% + ${strokeWidth}px)`;\n svg.style.pointerEvents = \"none\";\n\n const path = document.createElementNS(xmlns, \"path\");\n const adjustedCornerRadius = Math.max(0, cornerRadius - strokeWidth / 2);\n const d = `\n M ${strokeWidth / 2 + adjustedCornerRadius},${strokeWidth / 2}\n H ${adjustedWidth - strokeWidth / 2 - adjustedCornerRadius}\n A ${adjustedCornerRadius},${adjustedCornerRadius} 0 0 1 ${adjustedWidth - strokeWidth / 2},${\n strokeWidth / 2 + adjustedCornerRadius\n }\n V ${adjustedHeight - strokeWidth / 2 - adjustedCornerRadius}\n A ${adjustedCornerRadius},${adjustedCornerRadius} 0 0 1 ${\n adjustedWidth - strokeWidth / 2 - adjustedCornerRadius\n },${adjustedHeight - strokeWidth / 2}\n H ${strokeWidth / 2 + adjustedCornerRadius}\n A ${adjustedCornerRadius},${adjustedCornerRadius} 0 0 1 ${strokeWidth / 2},${\n adjustedHeight - strokeWidth / 2 - adjustedCornerRadius\n }\n V ${strokeWidth / 2 + adjustedCornerRadius}\n A ${adjustedCornerRadius},${adjustedCornerRadius} 0 0 1 ${strokeWidth / 2 + adjustedCornerRadius},${\n strokeWidth / 2\n }\n Z\n `;\n path.setAttribute(\"d\", d);\n path.setAttribute(\"fill\", \"none\");\n path.setAttribute(\"stroke\", \"var(--accent-color)\");\n path.setAttribute(\"stroke-width\", strokeWidth);\n path.setAttribute(\"stroke-dasharray\", dashArray);\n path.setAttribute(\"stroke-linejoin\", \"round\");\n\n svg.appendChild(path);\n\n element.appendChild(svg);\n}\n\ndocument.querySelectorAll(\".element-testimonials\").forEach((el) => {\n const container = el.querySelector(\".swiper\");\n const numSlides = el.querySelectorAll(\".swiper-slide\").length;\n\n new Swiper(container, {\n modules: [A11y, Autoplay, Pagination],\n slidesPerView: 1,\n autoplay: {\n delay: 5000,\n pauseOnMouseEnter: true,\n },\n speed: 1000,\n spaceBetween: 16,\n pagination: {\n el: el.querySelector(\".slider-pagination\"),\n clickable: true,\n },\n breakpoints: {\n 768: {\n slidesPerView: 2,\n spaceBetween: 24,\n },\n 1536: {\n centeredSlides: numSlides > 4,\n slidesPerView: 3,\n spaceBetween: 24,\n },\n },\n });\n});\n\nconst resizeObserver = new ResizeObserver(() => {\n document.querySelectorAll(\".element-testimonials figure\").forEach((figure) => {\n createDashedBorder(figure);\n });\n});\n\nresizeObserver.observe(document.body);\n"],"names":["document","querySelectorAll","forEach","el","container","querySelector","numSlides","length","Swiper","modules","A11y","Autoplay","Pagination","slidesPerView","autoplay","delay","pauseOnMouseEnter","speed","spaceBetween","pagination","clickable","breakpoints","centeredSlides","ResizeObserver","figure","element","options","remove","dashArray","cornerRadius","strokeWidth","rect","getBoundingClientRect","adjustedWidth","width","adjustedHeight","height","xmlns","svg","createElementNS","setAttribute","style","position","top","left","pointerEvents","path","adjustedCornerRadius","Math","max","d","appendChild","createDashedBorder","observe","body"],"sourceRoot":""}