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