!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("preact/compat"));else if("function"==typeof define&&define.amd)define(["preact/compat"],t);else{var r="object"==typeof exports?t(require("preact/compat")):t(e.PreactCompat);for(var a in r)("object"==typeof exports?exports:e)[a]=r[a]}}(Depicter,(e=>(()=>{"use strict";var t={585:t=>{t.exports=e}},r={};function a(e){var n=r[e];if(void 0!==n)return n.exports;var o=r[e]={exports:{}};return t[e](o,o.exports,a),o.exports}a.d=(e,t)=>{for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};a.r(n),a.d(n,{dpcOpinionScale:()=>m});var o=a(585);const c=e=>{const{className:t="dpc-opinion-scale-item",value:r,selected:a,onClick:n}=e;return Depicter.h("div",{className:`${t} ${a?"dpc-item-selected":""}`,onMouseDown:()=>n?.(r)},r)};var i,l;function p(){return p=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},p.apply(null,arguments)}const s=e=>o.createElement("svg",p({height:8,width:7,className:"shouldFlipIfRtl"},e),i||(i=o.createElement("path",{d:"M5 3.5v1.001H-.002v-1z"})),l||(l=o.createElement("path",{d:"M4.998 4L2.495 1.477 3.2.782 6.416 4 3.199 7.252l-.704-.709z"}))),d=e=>{const{className:t="dpc-opinion-scale",start:r,end:a,displayLabels:n=!1,leftLabel:i="Low",rightLabel:l="High",centerLabel:p="Neutral",name:d,itemMinWidth:u,breakpoint:m,renderLabel:f,formId:h,onChange:v}=e,[b,y]=(0,o.useState)(null),g=[...Array(parseInt(a,10)-parseInt(r,10)+1).keys().map((e=>e+parseInt(r,10)))],x=(0,o.useCallback)((e=>{y(e),v?.(e.toString())}),[v]),D=(0,o.useCallback)((e=>Depicter.h(c,{key:e,value:e,selected:b===e,onClick:x})),[x,b]),N={gridTemplateColumns:`repeat(auto-fit, minmax(${u}px, 1fr))`};return Depicter.h("div",{className:`${t} ${t}-${m}`},Depicter.h("div",{className:"dpc-items-container",style:N},g.map(D)),n&&Depicter.h("div",{className:"dpc-labels-container"},Depicter.h("span",{className:"dpc-item-text"},Depicter.h("span",{className:"dpc-text-indicator"},r," ",Depicter.h(s,null)),f?.("leftLabel",i,"")||i),Depicter.h("span",{className:"dpc-item-text"},Depicter.h("span",{className:"dpc-text-indicator"},Math.ceil(g.length/2)," ",Depicter.h(s,null)),f?.("centerLabel",p,"")||p),Depicter.h("span",{className:"dpc-item-text"},Depicter.h("span",{className:"dpc-text-indicator"},a," ",Depicter.h(s,null)),f?.("rightLabel",l,"")||l)),Depicter.h("input",{form:h,type:"hidden",name:d,value:b??"",readOnly:!0}))};function u(){return u=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},u.apply(null,arguments)}const m={component:e=>{const{composer:t,layer:r,required:a,...n}=e,[c,i]=(0,o.useState)("default"),l=(e,t)=>{i(t||"default")};(0,o.useEffect)((()=>{a&&t.survey.preventProceed(r.holder.index)}),[t,a,r.holder.index]);const p=(0,o.useCallback)((()=>{t.survey.resolveProceed(r.holder.index)}),[t,r.holder.index]);return(0,o.useEffect)((()=>(i(t.responsiveHelper.activeBreakpoint||"default"),t.responsiveHelper.on("breakpointChange",l),()=>{t.responsiveHelper.off("breakpointChange",l)})),[t]),Depicter.h(d,u({},n,{formId:t.survey?.formId,breakpoint:c,onChange:p}))},async:!1,pureScript:!1};return n})()));