"use strict";(self.webpackChunk_surecart_surecart=self.webpackChunk_surecart_surecart||[]).push([[6e3],{6e3:function(e,i,n){n.r(i),n.d(i,{sc_choices:function(){return d}});var t=n(9394),s=n(467),c=n(3029),a=n(2901),r=n(9280),h=n.n(r),o=n(1346),l=0,d=function(){return(0,a.A)((function e(i){(0,c.A)(this,e),(0,o.r)(this,i),this.inputId="choices-".concat(++l),this.helpId="choices-help-text-".concat(l),this.labelId="choices-label-".concat(l),this.label="",this.size="medium",this.autoWidth=void 0,this.required=!1,this.showLabel=!0,this.help="",this.hideLabel=!1,this.columns=1,this.errorMessage="",this.width=void 0}),[{key:"triggerFocus",value:(e=(0,s.A)(h().mark((function e(){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.el.focus();case 1:case"end":return e.stop()}}),e,this)}))),function(){return e.apply(this,arguments)})},{key:"componentDidLoad",value:function(){this.handleRequiredChange(),this.handleResize()}},{key:"handleRequiredChange",value:function(){var e=this,i=(0,t.A)(this.el.querySelectorAll("sc-choice, sc-choice-container"));i.length&&i.forEach((function(i){i.required=e.required}))}},{key:"handleResize",value:function(){var e=this;"ResizeObserver"in window&&new window.ResizeObserver((function(i){i.forEach((function(i){e.width=i.contentRect.width}))})).observe(this.el)}},{key:"render",value:function(){return(0,o.h)("fieldset",{key:"ea4020d4c4142c6a457070741d9a86e6b0a1f674",part:"base",class:{choices:!0,"choices--hide-label":this.hideLabel,"choices--auto-width":this.autoWidth,"breakpoint-sm":this.width<384,"breakpoint-md":this.width>=384&&this.width<576,"breakpoint-lg":this.width>=576&&this.width<768,"breakpoint-xl":this.width>=768},role:"radiogroup"},(0,o.h)("sc-form-control",{key:"d99ba5c8ea4a49be71ae748cfd3f76a8dfce3dca",exportparts:"label, help-text, form-control",size:this.size,required:this.required,label:this.label,showLabel:this.showLabel,help:this.help,inputId:this.inputId,helpId:this.helpId,labelId:this.labelId},(0,o.h)("div",{key:"fc1facfb37728185ffd4b2733903cd9600c8ba99",part:"choices",class:"choices__items"},(0,o.h)("slot",{key:"f67dc11aa7bae486288346412b6d80ef65639036"}))))}},{key:"el",get:function(){return(0,o.a)(this)}}],[{key:"watchers",get:function(){return{required:["handleRequiredChange"]}}}]);var e}();d.style=":host {\n  display: block;\n}\n\n.choices {\n  container-type: inline-size;\n}\n.choices ::slotted(div) {\n  margin: 0;\n  display: flex;\n  flex-wrap: wrap;\n  gap: var(--sc-choices-gap, 10px);\n}\n\n.choices:not(.choices--auto-width) ::slotted(div) {\n  margin: 0;\n  display: grid;\n  gap: var(--sc-choices-gap, 10px);\n}\n\n.breakpoint-lg ::slotted(div),\n.breakpoint-xl ::slotted(div) {\n  grid-template-columns: repeat(var(--columns, 1), 1fr);\n}\n\n.choices .choices__items {\n  margin: 0;\n  display: flex;\n  flex-wrap: wrap;\n  gap: var(--sc-choices-gap, 10px);\n}\n\n.choices:not(.choices--auto-width) .choices__items {\n  display: grid;\n  gap: var(--sc-choices-gap, 10px);\n}\n\n.choices {\n  border: none;\n  padding: 0;\n  margin: 0;\n  min-width: 0;\n  margin: 0;\n}\n.choices .choices__label {\n  font-family: var(--sc-input-font-family);\n  font-size: var(--sc-input-font-size-medium);\n  font-weight: var(--sc-input-font-weight);\n  color: var(--sc-input-color);\n  padding: 0 var(--sc-spacing-xx-small);\n}\n\n.choices__items {\n  display: grid;\n  gap: var(--sc-choices-gap, 10px);\n  grid-auto-rows: 1fr;\n}\n\n.choices__items {\n  grid-template-columns: repeat(var(--columns, 1), 1fr);\n}\n\n@container (max-width: 419px) {\n  .choices__items {\n    grid-template-columns: repeat(1, 1fr);\n  }\n}"}}]);