{"version":3,"file":"Shared.CFFwZPvD.mjs","names":["__esmMin","addPropertyControls","ControlType","init_framer_DcxuU94H","init_SuperfieldsShared","addPropertyControlsV2","showModeControl","id","controls","control","props","component","MODE_CONTROL","SUPPORT_CONTROL","parsePadding","padding","values","val","property","parseRadius","radius","init_Shared"],"sources":["https:/framerusercontent.com/modules/wzF1aUkHoslINE1PWbP0/pud8aXQ40ffzFv6s5hLJ/Shared.js"],"sourcesContent":["import{addPropertyControls,ControlType}from\"framer\";import{fillProp}from\"https://framerusercontent.com/modules/FZjYlw33eNo8pxLbSFLX/9cz7ek89fMdNfYUyPOlg/SuperfieldsShared.js\";const MODE_CONTROL={mode:{type:ControlType.Enum,defaultValue:\"basic\",options:[\"basic\",\"advanced\"],optionTitles:[\"Basic\",\"Advanced\"],displaySegmentedControl:true,segmentedControlDirection:\"vertical\"}};const SUPPORT_CONTROL={needHelp:{type:ControlType.Object,title:\"Need help?\",buttonTitle:\"Get Support\",icon:\"interaction\",controls:{info:{type:ControlType.Enum,defaultValue:\"info\",options:[\"info\"],optionTitles:[\"Support 🛟\"],displaySegmentedControl:true,title:\"Get Support\",description:\"We're here to help! The best place to get support is to visit our documentation to find your answers. We're also available on live chat.\\n\\n[Visit Superfields docs](https://insertframe.io/docs/superfields)\"}}}};export function addPropertyControlsV2(component,controls){let showModeControl=false;for(const id of Object.keys(controls)){const control=controls[id];if(control.advanced){showModeControl=true;if(control.hidden){control.hidden=props=>props.mode!==\"advanced\"||control.hidden(props);}else{control.hidden=props=>props.mode!==\"advanced\";}}}addPropertyControls(component,{...showModeControl?MODE_CONTROL:{},...controls,...SUPPORT_CONTROL});}export function buttonPropertyControlsV2({text=\"\",stylingDescription=\"Update the button styling.\",showAppearance=true,stylingPropsStart={},stylingPropsEnd={}}){const hiddenAppearance=showAppearance?props=>props.appearance!==\"default\":undefined;const hiddenAppearanceOutside=showAppearance?props=>props.styling.appearance===\"default\":undefined;return{styling:{type:ControlType.Object,title:\"Styling 🎨\",buttonTitle:\"Options\",description:stylingDescription,controls:{...showAppearance?{appearance:{type:ControlType.Enum,defaultValue:\"default\",options:[\"default\",\"custom\"],optionTitles:[\"Default\",\"Custom\"],displaySegmentedControl:true}}:{},text:{type:ControlType.String,defaultValue:text,hidden:hiddenAppearance},...stylingPropsStart,fill:fillProp({color:\"#000\",gradientColorA:\"#8C8C8C\",gradientColorB:\"#000\",hidden:hiddenAppearance}),font:{type:\"font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:14,lineHeight:1.4},hidden:hiddenAppearance},fontColor:{type:ControlType.Color,defaultValue:\"#FFF\",hidden:hiddenAppearance},padding:{type:ControlType.Padding,defaultValue:\"10px 16px 10px 16px\",hidden:hiddenAppearance},radius:{type:ControlType.BorderRadius,defaultValue:\"8px\",hidden:hiddenAppearance},border:{type:ControlType.Border,optional:true,hidden:hiddenAppearance},shadows:{type:ControlType.BoxShadow,hidden:hiddenAppearance},bgBlur:{type:ControlType.Number,min:0,max:100,step:1,displayStepper:true,title:\"BG Blur\",hidden:hiddenAppearance},...stylingPropsEnd}},...showAppearance?{customLayer:{type:ControlType.ComponentInstance,title:\"Layer\",description:\"Connect a custom layer from outside the breakpoint\",hidden:hiddenAppearanceOutside}}:{}};}export function parseButtonPropertyControlsV2(props){const{styling,customLayer}=props;const{radius,padding,text,...otherStyling}=styling;return{...otherStyling,...parsePadding(padding),...parseRadius(radius),text,customLayer};}export const idControl={type:ControlType.Number,defaultValue:0,step:1,min:0,displayStepper:true,title:\"ID\",description:\"If using multiple collections on the same page, set a specific ID to match.\"};export function parsePadding(padding,property=\"padding\"){if(padding&&typeof padding===\"string\"){// Split the input string by spaces and convert each to an integer\nconst values=padding.trim().split(/\\s+/).map(val=>parseInt(val,10));// If only one value is provided, replicate it four times\nif(values.length===1){return{[property]:values[0],[`${property}IsMixed`]:false};}else if(values.length===4){return{[property]:null,[`${property}IsMixed`]:true,[`${property}Top`]:values[0],[`${property}Right`]:values[1],[`${property}Bottom`]:values[2],[`${property}Left`]:values[3]};}}return{[property]:0,[`${property}IsMixed`]:false};}export function parseRadius(radius,property=\"radius\"){if(radius&&typeof radius===\"string\"){// Split the input string by spaces and convert each to an integer\nconst values=radius.trim().split(/\\s+/).map(val=>parseInt(val,10));// If only one value is provided, replicate it four times\nif(values.length===1){return{[property]:values[0],[`${property}IsMixed`]:false};}else if(values.length===4){return{[property]:null,[`${property}IsMixed`]:true,[`${property}TopLeft`]:values[0],[`${property}TopRight`]:values[1],[`${property}BottomRight`]:values[2],[`${property}BottomLeft`]:values[3]};}}return{[property]:0,[`${property}IsMixed`]:false};}\nexport const __FramerMetadata__ = {\"exports\":{\"idControl\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"parsePadding\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"buttonPropertyControlsV2\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"parseRadius\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"addPropertyControlsV2\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"parseButtonPropertyControlsV2\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],"mappings":"A,kKAAw2B,SAAgBK,EAAsB,EAAU,EAAS,CAAC,IAAIC,EAAgB,GAAM,IAAI,IAAMC,KAAM,OAAO,KAAKC,CAAQ,EAAE,CAAC,IAAMC,EAAQD,EAASD,GAAOE,EAAQ,WAAU,EAAgB,GAAK,AAA8FA,EAAQ,OAAnGA,EAAQ,OAAuB,GAAOC,EAAM,OAAO,YAAYD,EAAQ,OAAOC,CAAK,EAAuB,GAAOA,EAAM,OAAO,WAAa,CAACT,EAAoBU,EAAU,CAAC,GAAGL,EAAgBM,EAAa,CAAC,EAAE,GAAGJ,EAAS,GAAGK,CAAe,CAAC,CAAE,CAAmjE,SAAgBC,EAAa,EAAQ,EAAS,UAAU,C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