@explorer02/cfm-survey-sdk 0.3.8 → 0.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/index.js +1 -1
- package/dist/cli/index.mjs +1 -1
- package/package.json +1 -1
- package/templates/docs/templates/CsatMatrixScale.tsx +24 -22
- package/templates/docs/templates/Header.tsx +2 -1
- package/templates/docs/templates/Question.tsx +13 -2
- package/templates/docs/templates/SliderMatrixScale.tsx +2 -3
- package/templates/docs/templates/uiConfig.ts +4 -2
- package/templates/preview-harness/preview-bridge.inline.js +5 -3
- package/templates/preview-harness/vite-app/src/fixtures/questions.ts +25 -31
- package/templates/previewBridge.ts +6 -2
- package/templates/survey-theme.css +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";var dt=Object.create;var Ve=Object.defineProperty;var ft=Object.getOwnPropertyDescriptor;var ut=Object.getOwnPropertyNames;var pt=Object.getPrototypeOf,gt=Object.prototype.hasOwnProperty;var q=(e,o)=>()=>(e&&(o=e(e=0)),o);var Ne=(e,o)=>{for(var t in o)Ve(e,t,{get:o[t],enumerable:!0})},mt=(e,o,t,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let r of ut(o))!gt.call(e,r)&&r!==t&&Ve(e,r,{get:()=>o[r],enumerable:!(n=ft(o,r))||n.enumerable});return e};var A=(e,o,t)=>(t=e!=null?dt(pt(e)):{},mt(o||!e||!e.__esModule?Ve(t,"default",{value:e,enumerable:!0}):t,e));var l,W=q(()=>{"use strict";l={reset:"\x1B[0m",bold:"\x1B[1m",green:"\x1B[32m",red:"\x1B[31m",cyan:"\x1B[36m",yellow:"\x1B[33m",dim:"\x1B[2m"}});var G,Te=q(()=>{"use strict";G=["MCQ","TEXTFIELD","NPS_SCALE","CFM_MATRIX","CSAT_MATRIX","RATING_MATRIX","SLIDER_MATRIX","FILE_UPLOAD","TEXT_AND_MEDIA","HEATMAP","RANK_ORDER"]});function wt(e){let o={};for(let t of e)yo[t]&&(o[t]={...yo[t]});return o}function bt(e=[],o){return{version:"1.0",instanceId:o,surveyTypes:e,global:{surveyTitle:"Customer Feedback Survey",companyName:"Sprinklr",browserTabTitle:"Customer Feedback Survey",thankYouMessage:"Thank you for your valuable feedback!",logo:{fileName:null,url:null},header:{height:120,logoBoxWidth:120,logoBoxHeight:120,logoPadding:10,logoPlacement:"left",showCompanyName:!0,companyNamePlacement:"left",companyNameFontSize:18,companyNameFontWeight:600,companyNameColor:"#1A1F36",backgroundColor:"#FFFFFF",shadowEnabled:!0,borderBottomColor:"#E5E7EB",contentPaddingX:40},footer:{backgroundColor:"#262626",textColor:"#9CA3AF",linkColor:"#9CA3AF",linkHoverColor:"#FFFFFF",showLogo:!0,logoWidth:120,logoHeight:32,logoPlacement:"left",copyrightText:"\xA9 Company Name",layout:"row",paddingY:24,paddingX:40,links:[]},theme:{pageBackground:"#FFFFFF",cardBackground:"#FFFFFF",cardBorderColor:"#E5E7EB",cardPadding:24,cardShadowEnabled:!0,selectedBackground:"#E8F5FD",zebraRowColor:"rgba(249,250,251,0.8)",rowBandColor:"#F3F4F6",validationBorder:"#333333",validationBackground:"#D9D9D9",tooltipBackground:"#1F2937",progressTrackHeight:12,progressTrackColor:"#E5E7EB",progressFillColor:"#1A1F36",stickyChromePaddingTop:16,stickyChromePaddingBottom:20,languageSelectorBackground:"#FFFFFF",languageSelectorTextColor:"#2563EB",languageSelectorBorderColor:"#2563EB"},layout:{showHeader:!0,showFooter:!0,showProgressBar:!0,showLanguageSwitcher:!1,showNextButton:!0,showBackButton:!0,showQuestionNumbers:!0,showRequiredAsterisk:!0,width:"standard",borderStyle:"rounded",fontStyle:"modern"},buttons:{next:"Next",back:"Back",submit:"Submit"},colorScheme:{...L},colorSource:"auto",typography:{fontFamily:"Inter, sans-serif",headingWeight:700},motion:{enabled:!1,durationMs:200}},questionTypes:wt(e),placeholders:{firstName:"Alex",lastName:"Customer",email:"alex@example.com"},customFields:{},debug:{enabled:!1,sampleAnswers:{}},deploy:{target:"aws",autoDeploy:!1}}}function ee(e,o){return{...e,...o??{}}}function De(e){let o=(e.surveyTypes??[]).filter(c=>G.includes(c)),t=[...new Set([...o,...G])],n=bt(t,e.instanceId),r=e.global??{},i=n.global,s={...n.questionTypes};if(e.questionTypes)for(let[c,d]of Object.entries(e.questionTypes))s[c]={...s[c]??{},...d};return{...n,...e,configuredAt:void 0,surveyTypes:o.length?o:n.surveyTypes,global:{...i,...r,header:ee(i.header,r.header),footer:ee(i.footer,r.footer),theme:ee(i.theme,r.theme),layout:ee(i.layout,r.layout),buttons:ee(i.buttons,r.buttons),logo:ee(i.logo,r.logo),colorScheme:ee(i.colorScheme,r.colorScheme),typography:ee(i.typography,r.typography),motion:ee(i.motion,r.motion)},questionTypes:s,placeholders:{...n.placeholders,...e.placeholders??{}},customFields:{...n.customFields,...e.customFields??{}},debug:{enabled:e.debug?.enabled??n.debug?.enabled??!1,sampleAnswers:e.debug?.sampleAnswers??n.debug?.sampleAnswers},deploy:{...n.deploy,...e.deploy??{}}}}var L,yo,Je=q(()=>{"use strict";Te();L={primary:"#1A1F36",secondary:"#E8F5FD",accent:"#00B5AD",background:"#FFFFFF",text:"#1A1F36",buttonText:"#FFFFFF"},yo={MCQ:{cardStyle:"outlined",selectedAccent:L.accent,optionGap:8,borderRadius:8,cardPadding:12,selectedBackground:L.secondary,hoverBorderColor:L.accent},TEXTFIELD:{inputRadius:8,focusRing:L.accent,borderColor:"#E5E7EB",inputPadding:12,inputHeight:44,placeholderColor:"#9CA3AF"},NPS_SCALE:{buttonStyle:"standard",selectedFill:L.secondary,labelColor:L.text,trackBarColor:"#F2F2F2",trackHighlightColor:"#FBE8F3",cellSize:40,cellGap:4},CFM_MATRIX:{rowLabelWidth:180,cellSelectedColor:L.accent,headerStyle:"bold",bipolarColumnWidthPercent:25,carouselDotColor:"#2563EB",cellPadding:8},CSAT_MATRIX:{rowLabelWidth:180,cellSelectedColor:L.accent,headerStyle:"bold",bipolarColumnWidthPercent:25,carouselDotColor:L.primary,cellPadding:8,accentColor:L.accent,emojiSize:24,unselectedOpacity:.5,selectedRingColor:L.accent,cellSize:40,tooltipBg:"#1F2937",graphicsTrackColor:"#E5E7EB",graphicsThumbColor:L.accent},RATING_MATRIX:{starColor:"#F59E0B",badgeColor:L.primary,rowLabelWidth:180,unselectedStarOpacity:.5,graphicsTrackColor:"#E5E7EB",graphicsThumbColor:L.primary},SLIDER_MATRIX:{trackColor:L.accent,thumbColor:L.primary,tickColor:"#9CA3AF",rowLabelWidth:180,rowBandColor:"#F3F4F6",tickBadgeSize:28,hintMinText:"Label 1",hintMaxText:"Label 2",hintLabelColor:"#6B7280",hintLabelBgColor:"transparent"},FILE_UPLOAD:{dropzoneStyle:"dashed",accentColor:L.accent,dropzonePadding:24},TEXT_AND_MEDIA:{mediaMaxWidth:100,mediaRadius:8,captionColor:"#6B7280",captionSize:14},HEATMAP:{pinColor:L.accent,pinSize:12,pinBorderColor:"#FFFFFF",overlayOpacity:.3},RANK_ORDER:{drag:{itemBg:"#F9FAFB",dragHandleColor:"#9CA3AF",rankBadgeColor:L.primary,itemPadding:12,itemGap:8},dropdown:{itemBg:"#F9FAFB",selectBorderColor:"#E5E7EB",rankBadgeColor:L.primary,itemPadding:12,itemGap:8}}}});function Co(e){let o={},t=/--cfm-[\w-]+\s*:\s*([^;]+);/g,n;for(;(n=t.exec(e))!==null;){let r=n[0].split(":")[0].trim(),i=n[1].trim();o[r]=i}return o}function E(e){if(!e)return;let o=parseFloat(e.replace(/px$/,""));return Number.isFinite(o)?o:void 0}function So(e){if(!e)return;let o=parseFloat(e.replace(/%$/,""));return Number.isFinite(o)?o:void 0}function xe(e){if(!e)return;let o=parseFloat(e);return Number.isFinite(o)?o:void 0}function To(e){let o={global:{},questionTypes:{}},t=o.global,n={},r={},i={},s={},c={},d={},g={},b=o.questionTypes;if(e["--cfm-primary"]&&(n.primary=e["--cfm-primary"]),e["--cfm-secondary"]&&(n.secondary=e["--cfm-secondary"]),e["--cfm-accent"]&&(n.accent=e["--cfm-accent"]),e["--cfm-background"]&&(n.background=e["--cfm-background"]),e["--cfm-text"]&&(n.text=e["--cfm-text"]),e["--cfm-button-text"]&&(n.buttonText=e["--cfm-button-text"]),e["--cfm-max-width"]&&ho[e["--cfm-max-width"]]&&(c.width=ho[e["--cfm-max-width"]]),e["--cfm-border-radius"]&&wo[e["--cfm-border-radius"]]&&(c.borderStyle=wo[e["--cfm-border-radius"]]),e["--cfm-font-family"]&&(d.fontFamily=e["--cfm-font-family"],bo[e["--cfm-font-family"]]&&(c.fontStyle=bo[e["--cfm-font-family"]])),e["--cfm-heading-weight"]&&(d.headingWeight=xe(e["--cfm-heading-weight"])),e["--cfm-motion-duration"]){let O=E(e["--cfm-motion-duration"]);O!==void 0&&(g.durationMs=O,g.enabled=O>0)}e["--cfm-header-height"]&&(r.height=E(e["--cfm-header-height"])),e["--cfm-header-logo-width"]&&(r.logoBoxWidth=E(e["--cfm-header-logo-width"])),e["--cfm-header-logo-height"]&&(r.logoBoxHeight=E(e["--cfm-header-logo-height"])),e["--cfm-header-logo-padding"]&&(r.logoPadding=E(e["--cfm-header-logo-padding"])),e["--cfm-header-bg"]&&(r.backgroundColor=e["--cfm-header-bg"]),e["--cfm-header-company-color"]&&(r.companyNameColor=e["--cfm-header-company-color"]),e["--cfm-header-company-size"]&&(r.companyNameFontSize=E(e["--cfm-header-company-size"])),e["--cfm-header-company-weight"]&&(r.companyNameFontWeight=xe(e["--cfm-header-company-weight"])),e["--cfm-header-border"]&&(r.borderBottomColor=e["--cfm-header-border"]),e["--cfm-header-padding-x"]&&(r.contentPaddingX=E(e["--cfm-header-padding-x"])),e["--cfm-footer-bg"]&&(i.backgroundColor=e["--cfm-footer-bg"]),e["--cfm-footer-text"]&&(i.textColor=e["--cfm-footer-text"]),e["--cfm-footer-link"]&&(i.linkColor=e["--cfm-footer-link"]),e["--cfm-footer-link-hover"]&&(i.linkHoverColor=e["--cfm-footer-link-hover"]),e["--cfm-footer-logo-width"]&&(i.logoWidth=E(e["--cfm-footer-logo-width"])),e["--cfm-footer-logo-height"]&&(i.logoHeight=E(e["--cfm-footer-logo-height"])),e["--cfm-footer-padding-y"]&&(i.paddingY=E(e["--cfm-footer-padding-y"])),e["--cfm-footer-padding-x"]&&(i.paddingX=E(e["--cfm-footer-padding-x"])),e["--cfm-background"]&&(s.pageBackground=e["--cfm-background"]),e["--cfm-card-bg"]&&(s.cardBackground=e["--cfm-card-bg"]),e["--cfm-card-border-color"]&&(s.cardBorderColor=e["--cfm-card-border-color"]),e["--cfm-card-padding"]&&(s.cardPadding=E(e["--cfm-card-padding"])),e["--cfm-card-shadow"]&&(s.cardShadowEnabled=e["--cfm-card-shadow"]!=="none"),e["--cfm-selected-bg"]&&(s.selectedBackground=e["--cfm-selected-bg"]),e["--cfm-zebra-row"]&&(s.zebraRowColor=e["--cfm-zebra-row"]),e["--cfm-row-band"]&&(s.rowBandColor=e["--cfm-row-band"]),e["--cfm-validation-border"]&&(s.validationBorder=e["--cfm-validation-border"]),e["--cfm-validation-bg"]&&(s.validationBackground=e["--cfm-validation-bg"]),e["--cfm-tooltip-bg"]&&(s.tooltipBackground=e["--cfm-tooltip-bg"]),e["--cfm-progress-height"]&&(s.progressTrackHeight=E(e["--cfm-progress-height"])),e["--cfm-progress-track"]&&(s.progressTrackColor=e["--cfm-progress-track"]),e["--cfm-progress-fill"]&&(s.progressFillColor=e["--cfm-progress-fill"]),e["--cfm-sticky-pt"]&&(s.stickyChromePaddingTop=E(e["--cfm-sticky-pt"])),e["--cfm-sticky-pb"]&&(s.stickyChromePaddingBottom=E(e["--cfm-sticky-pb"]));let S={};e["--cfm-mcq-selected-accent"]&&(S.selectedAccent=e["--cfm-mcq-selected-accent"]),e["--cfm-mcq-border-radius"]&&(S.borderRadius=E(e["--cfm-mcq-border-radius"])),e["--cfm-mcq-option-gap"]&&(S.optionGap=E(e["--cfm-mcq-option-gap"])),e["--cfm-mcq-card-padding"]&&(S.cardPadding=E(e["--cfm-mcq-card-padding"])),e["--cfm-mcq-selected-bg"]&&(S.selectedBackground=e["--cfm-mcq-selected-bg"]),e["--cfm-mcq-hover-border"]&&(S.hoverBorderColor=e["--cfm-mcq-hover-border"]),Object.keys(S).length&&(b.MCQ=S);let x={};e["--cfm-input-radius"]&&(x.inputRadius=E(e["--cfm-input-radius"])),e["--cfm-input-focus-ring"]&&(x.focusRing=e["--cfm-input-focus-ring"]),e["--cfm-input-border"]&&(x.borderColor=e["--cfm-input-border"]),e["--cfm-input-padding"]&&(x.inputPadding=E(e["--cfm-input-padding"])),e["--cfm-input-height"]&&(x.inputHeight=E(e["--cfm-input-height"])),e["--cfm-input-placeholder"]&&(x.placeholderColor=e["--cfm-input-placeholder"]),Object.keys(x).length&&(b.TEXTFIELD=x);let F={};e["--cfm-nps-selected-fill"]&&(F.selectedFill=e["--cfm-nps-selected-fill"]),e["--cfm-nps-label-color"]&&(F.labelColor=e["--cfm-nps-label-color"]),e["--cfm-nps-track-bar"]&&(F.trackBarColor=e["--cfm-nps-track-bar"]),e["--cfm-nps-track-highlight"]&&(F.trackHighlightColor=e["--cfm-nps-track-highlight"]),e["--cfm-nps-cell-size"]&&(F.cellSize=E(e["--cfm-nps-cell-size"])),e["--cfm-nps-cell-gap"]&&(F.cellGap=E(e["--cfm-nps-cell-gap"])),Object.keys(F).length&&(b.NPS_SCALE=F);let k=E(e["--cfm-matrix-row-width"]),$={};k!==void 0&&($.rowLabelWidth=k),e["--cfm-matrix-selected"]&&($.cellSelectedColor=e["--cfm-matrix-selected"]),e["--cfm-matrix-bipolar-width"]&&($.bipolarColumnWidthPercent=So(e["--cfm-matrix-bipolar-width"])),e["--cfm-matrix-carousel-dot"]&&($.carouselDotColor=e["--cfm-matrix-carousel-dot"]),e["--cfm-matrix-cell-padding"]&&($.cellPadding=E(e["--cfm-matrix-cell-padding"])),Object.keys($).length&&(b.CFM_MATRIX=$);let f={...$};e["--cfm-csat-accent"]&&(f.accentColor=e["--cfm-csat-accent"]),e["--cfm-csat-emoji-size"]&&(f.emojiSize=E(e["--cfm-csat-emoji-size"])),e["--cfm-csat-unselected-opacity"]&&(f.unselectedOpacity=xe(e["--cfm-csat-unselected-opacity"])),e["--cfm-csat-ring-color"]&&(f.selectedRingColor=e["--cfm-csat-ring-color"]),e["--cfm-csat-cell-size"]&&(f.cellSize=E(e["--cfm-csat-cell-size"])),e["--cfm-csat-tooltip-bg"]&&(f.tooltipBg=e["--cfm-csat-tooltip-bg"]),(Object.keys(f).length>Object.keys($).length||e["--cfm-csat-accent"])&&(b.CSAT_MATRIX=f);let y={};e["--cfm-star-color"]&&(y.starColor=e["--cfm-star-color"]),e["--cfm-badge-color"]&&(y.badgeColor=e["--cfm-badge-color"]),k!==void 0&&(y.rowLabelWidth=k),e["--cfm-star-unselected-opacity"]&&(y.unselectedStarOpacity=xe(e["--cfm-star-unselected-opacity"])),Object.keys(y).length&&(b.RATING_MATRIX=y);let T={};e["--cfm-slider-track"]&&(T.trackColor=e["--cfm-slider-track"]),e["--cfm-slider-thumb"]&&(T.thumbColor=e["--cfm-slider-thumb"]),e["--cfm-slider-tick"]&&(T.tickColor=e["--cfm-slider-tick"]),k!==void 0&&(T.rowLabelWidth=k),e["--cfm-slider-row-band"]&&(T.rowBandColor=e["--cfm-slider-row-band"]),e["--cfm-slider-tick-size"]&&(T.tickBadgeSize=E(e["--cfm-slider-tick-size"])),Object.keys(T).length&&(b.SLIDER_MATRIX=T);let R={};e["--cfm-upload-accent"]&&(R.accentColor=e["--cfm-upload-accent"]),e["--cfm-upload-padding"]&&(R.dropzonePadding=E(e["--cfm-upload-padding"])),Object.keys(R).length&&(b.FILE_UPLOAD=R);let w={};e["--cfm-media-max-width"]&&(w.mediaMaxWidth=So(e["--cfm-media-max-width"])),e["--cfm-media-radius"]&&(w.mediaRadius=E(e["--cfm-media-radius"])),e["--cfm-media-caption-color"]&&(w.captionColor=e["--cfm-media-caption-color"]),e["--cfm-media-caption-size"]&&(w.captionSize=E(e["--cfm-media-caption-size"])),Object.keys(w).length&&(b.TEXT_AND_MEDIA=w);let P={};e["--cfm-heatmap-pin"]&&(P.pinColor=e["--cfm-heatmap-pin"]),e["--cfm-heatmap-pin-size"]&&(P.pinSize=E(e["--cfm-heatmap-pin-size"])),e["--cfm-heatmap-pin-border"]&&(P.pinBorderColor=e["--cfm-heatmap-pin-border"]),e["--cfm-heatmap-overlay-opacity"]&&(P.overlayOpacity=xe(e["--cfm-heatmap-overlay-opacity"])),Object.keys(P).length&&(b.HEATMAP=P);let C={};return e["--cfm-rank-item-bg"]&&(C.itemBg=e["--cfm-rank-item-bg"]),e["--cfm-rank-badge"]&&(C.rankBadgeColor=e["--cfm-rank-badge"]),e["--cfm-rank-handle"]&&(C.dragHandleColor=e["--cfm-rank-handle"]),e["--cfm-rank-item-padding"]&&(C.itemPadding=E(e["--cfm-rank-item-padding"])),e["--cfm-rank-item-gap"]&&(C.itemGap=E(e["--cfm-rank-item-gap"])),Object.keys(C).length&&(b.RANK_ORDER=C),Object.keys(n).length&&(t.colorScheme=n),Object.keys(r).length&&(t.header=r),Object.keys(i).length&&(t.footer=i),Object.keys(s).length&&(t.theme=s),Object.keys(c).length&&(t.layout=c),Object.keys(d).length&&(t.typography=d),Object.keys(g).length&&(t.motion=g),o}function ue(e){let o=[Re.join(e,"src","styles","survey-theme.css"),Re.join(e,"src","app","survey-theme.css"),Re.join(e,"src","styles","globals.css"),Re.join(e,"src","app","globals.css")];for(let t of o)if(ve.existsSync(t)&&ve.readFileSync(t,"utf8").includes("--cfm-"))return t;return null}var ve,Re,ho,wo,bo,Le=q(()=>{"use strict";ve=A(require("fs")),Re=A(require("path")),ho={"36rem":"narrow","48rem":"standard","64rem":"wide"},wo={"0px":"sharp","12px":"rounded","9999px":"pill"},bo={"system-ui, sans-serif":"system","Inter, sans-serif":"modern","Georgia, serif":"serif"}});function Ct(e){for(let o of St){let t=xo.join(e,o);if(Me.existsSync(t))return t}return null}function Tt(e){let o=e.trim();if(!o||o.startsWith("http")||o.startsWith("data:"))return null;let t=o.split("?")[0];return t.startsWith("/")?t.slice(1):t}function Ro(e){let o=Ct(e);if(!o)return null;let t=Me.readFileSync(o,"utf8"),n=t.match(/data-cfm-logo[\s\S]*?src=["']([^"']+)["']/i)??t.match(/src=["']([^"']+)["'][\s\S]*?data-cfm-logo/i);if(n){let s=Tt(n[1]);if(s)return{mode:"image",publicPath:s,fileName:s}}let r=t.match(/data-cfm-logo-text[^>]*>([^<]+)</i);if(r)return{mode:"text",label:r[1].trim()};let i=t.match(/data-cfm-company[^>]*>([^<]+)</i);return i&&!n?{mode:"text",label:i[1].trim()}:null}var Me,xo,St,$o=q(()=>{"use strict";Me=A(require("fs")),xo=A(require("path")),St=["src/components/Header.tsx","components/Header.tsx","app/components/Header.tsx"]});var Po={};Ne(Po,{logSeedSource:()=>Qe,resolveInitialConfig:()=>ge,writeResolvedUiConfig:()=>Ke});function Ge(e){return e.filter(o=>G.includes(o))}function Ao(e){try{let o=JSON.parse(Q.readFileSync(e,"utf8"));return o.version!=="1.0"?null:(delete o.configuredAt,o)}catch{return null}}function $t(e){let o={global:{}};if(!Q.existsSync(e))return o;let t=Q.readFileSync(e,"utf8"),n=new Set;for(let i of G)t.includes(i)&&n.add(i);n.size&&(o.surveyTypes=[...n]);let r=t.match(/\*\*Branding source:\*\*\s*(.+)/i);if(r){let i=r[1].trim(),s=i.match(/company[:\s]+([^,;]+)/i),c=i.match(/title[:\s]+([^,;]+)/i);if(s&&(o.global.companyName=s[1].trim()),c){let d=c[1].trim();o.global.surveyTitle=d,o.global.browserTabTitle=d}}return o}function Fo(e,o){let t=oe.join(e,o);if(!Q.existsSync(t))return null;let n=Q.readFileSync(t);if(n.length>xt)return{fileName:o,dataUrl:""};let r=oe.extname(o).toLowerCase(),i=Rt[r]??"application/octet-stream";return{fileName:o,dataUrl:`data:${i};base64,${n.toString("base64")}`}}function Eo(e,o){if(!o)return null;if(o.url&&typeof o.url=="string")return{fileName:o.fileName??null,url:o.url};if(o.fileName){let t=Fo(e,o.fileName);if(t)return{fileName:t.fileName,url:t.dataUrl||null}}return o.fileName===null&&o.url===null?{fileName:null,url:null}:null}function ko(e,o){let t=e.global??{},n=o.global??{},r=e.questionTypes??{},i=o.questionTypes??{},s={...r};for(let[c,d]of Object.entries(i))s[c]={...s[c]??{},...d};return{...e,...o,surveyTypes:o.surveyTypes??e.surveyTypes,global:{...t,...n,header:{...t.header,...n.header},footer:{...t.footer,...n.footer},theme:{...t.theme,...n.theme},layout:{...t.layout,...n.layout},buttons:{...t.buttons,...n.buttons},logo:{...t.logo,...n.logo},colorScheme:{...t.colorScheme,...n.colorScheme},typography:{...t.typography,...n.typography},motion:{...t.motion,...n.motion}},questionTypes:s,placeholders:{...e.placeholders,...o.placeholders},customFields:{...e.customFields,...o.customFields},deploy:{...e.deploy,...o.deploy}}}function ge(e){let o=e.projectRoot??process.env.INIT_CWD??process.cwd(),t=oe.join(o,"survey-ui-config.json"),n=oe.join(o,"implementation_plan.md"),r=oe.join(o,"public"),i=Ge(e.surveyTypes),s={},c="defaults",d=ue(o);if(d){let C=Q.readFileSync(d,"utf8"),O=Co(C);Object.keys(O).length>0&&(s=To(O),c="survey-theme.css")}let g=$t(n);s=ko(s,g);let b=Ao(t);b&&(s=ko(s,b),c="survey-ui-config.json");let S=oe.join(o,"survey-ui-config.final.json"),x=Ao(S),F=!!b?.configuredAt,k=!!x?.configuredAt;if(x&&k&&!F){let C=Eo(r,x.global?.logo);C&&(s.global={...s.global??{},logo:{fileName:C.fileName,url:C.url}})}let $=Eo(r,s.global?.logo),f=Ro(o),y=!!b?.configuredAt,T=$?.fileName!=null&&/^logo_\d+_/i.test($.fileName),R=f?.mode==="image"?f.fileName:null,w=!y&&T&&R!=null&&$?.fileName!==R;if($&&!w)s.global={...s.global??{},logo:{fileName:$.fileName,url:$.url}};else if(f?.mode==="image"){let C=Fo(r,f.fileName);s.global={...s.global??{},logo:{fileName:f.fileName,url:C?.dataUrl||null}}}else f?.mode==="text"&&(s.global={...s.global??{},logo:{fileName:null,url:null},companyName:s.global?.companyName??f.label});return s.surveyTypes=Ge(s.surveyTypes??i),s.surveyTypes?.length||(s.surveyTypes=i),e.instanceId&&(s.instanceId=e.instanceId),{config:De(s),source:c}}function Qe(e){console.log(e==="survey-ui-config.json"?`${pe.dim} Seeding wizard from survey-ui-config.json${pe.reset}`:e==="survey-theme.css"?`${pe.dim} Seeding wizard from survey-theme.css + defaults${pe.reset}`:`${pe.dim} Seeding wizard from SDK defaults${pe.reset}`)}function Ke(e={}){let o=e.projectRoot??process.env.INIT_CWD??process.cwd(),t=e.surveyTypes??Ge(G),{config:n}=ge({projectRoot:o,surveyTypes:t,instanceId:e.instanceId}),r=oe.join(o,"survey-ui-config.json");return Q.writeFileSync(r,JSON.stringify(n,null,2),"utf8"),r}var Q,oe,pe,xt,Rt,$e=q(()=>{"use strict";Q=A(require("fs")),oe=A(require("path"));W();Je();Le();Te();$o();pe=l,xt=512e3,Rt={".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".svg":"image/svg+xml"}});function X(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function h(e,o){return typeof e=="number"&&Number.isFinite(e)?e:o}function a(e,o){return typeof e=="string"&&e.length?e:o}function Lt(){return{"--cfm-header-brand-gap":"16px","--cfm-header-padding-y":"12px","--cfm-header-company-margin-top":"0","--cfm-header-company-margin-left":"0","--cfm-header-company-margin-right":"0","--cfm-header-logo-col":"1","--cfm-header-logo-justify":"start"}}function Mt(){return{"--cfm-footer-inner-display":"grid","--cfm-footer-inner-direction":"row","--cfm-footer-logo-col":"1","--cfm-footer-logo-justify":"start","--cfm-footer-links-col":"3","--cfm-footer-links-justify":"end","--cfm-footer-logo-copyright-gap":"12px"}}function Oe(e,o){o.numberLabelMode&&(e["--cfm-number-label-mode"]=a(o.numberLabelMode,"traffic")),o.monochromeNumberColor&&(e["--cfm-number-mono-color"]=a(o.monochromeNumberColor,"#9CA3AF"));let t=o.individualNumberColors;Array.isArray(t)&&t.forEach((n,r)=>{typeof n=="string"&&(e[`--cfm-number-color-${r}`]=n)})}function Bo(e,o){o.hintLabelColor&&(e["--cfm-hint-label-color"]=a(o.hintLabelColor,"#6B7280")),o.hintLabelBgColor&&(e["--cfm-hint-label-bg"]=a(o.hintLabelBgColor,"transparent"))}function Ue(e,o,t){(t==="matrix"||t==="csat")&&(o.columnLabelColor&&(e["--cfm-matrix-column-label-color"]=a(o.columnLabelColor,"#4B5563")),o.columnLabelBgColor&&(e["--cfm-matrix-column-label-bg"]=a(o.columnLabelBgColor,"transparent"))),t==="csat"&&(o.columnLabelColor&&(e["--cfm-csat-column-label-color"]=a(o.columnLabelColor,"#4B5563")),o.columnLabelBgColor&&(e["--cfm-csat-column-label-bg"]=a(o.columnLabelBgColor,"transparent"))),t==="rating"&&(o.columnLabelColor&&(e["--cfm-rating-column-label-color"]=a(o.columnLabelColor,"#4B5563")),o.columnLabelBgColor&&(e["--cfm-rating-column-label-bg"]=a(o.columnLabelBgColor,"transparent"))),t==="slider"&&(o.columnLabelColor&&(e["--cfm-slider-tick-label-color"]=a(o.columnLabelColor,"#4B5563")),o.columnLabelBgColor&&(e["--cfm-slider-tick-label-bg"]=a(o.columnLabelBgColor,"transparent")))}function Bt(e,o){let t=a(o.optionStyle??o.cardStyle,"outlined");e["--cfm-mcq-border-radius"]=`${h(o.borderRadius,8)}px`,e["--cfm-mcq-option-gap"]=`${h(o.optionGap,8)}px`,e["--cfm-mcq-card-padding"]=`${h(o.optionPadding??o.cardPadding,12)}px`,e["--cfm-mcq-hover-border"]=a(o.hoverBorderColor,"#00B5AD"),e["--cfm-mcq-option-style"]=t,o.filledOptionBg&&(e["--cfm-mcq-filled-bg"]=a(o.filledOptionBg,"#F9FAFB"))}function Ot(e,o){e["--cfm-input-radius"]=`${h(o.inputRadius,8)}px`,e["--cfm-input-border"]=a(o.borderColor,"#E5E7EB"),e["--cfm-input-padding"]=`${h(o.inputPadding,12)}px`,e["--cfm-input-height"]=`${h(o.inputHeight,44)}px`,e["--cfm-input-placeholder"]=a(o.placeholderColor,"#9CA3AF")}function Ut(e,o){e["--cfm-nps-cell-size"]=`${h(o.cellSize,40)}px`,e["--cfm-nps-cell-gap"]=`${h(o.cellGap,4)}px`,e["--cfm-nps-button-style"]=a(o.buttonStyle,"standard"),e["--cfm-nps-selected-fill"]=a(o.selectedFill,"#E8F5FD"),e["--cfm-nps-track-bar"]=a(o.trackBarColor,"#F2F2F2"),e["--cfm-nps-track-highlight"]=a(o.trackHighlightColor,"#FBE8F3"),Bo(e,o),Oe(e,o)}function zt(e,o){e["--cfm-matrix-row-width"]=`${h(o.rowLabelWidth,180)}px`,e["--cfm-matrix-bipolar-width"]=`${h(o.bipolarColumnWidthPercent,25)}%`,e["--cfm-matrix-cell-padding"]=`${h(o.cellPadding,8)}px`,o.carouselDotColor&&(e["--cfm-matrix-carousel-dot"]=a(o.carouselDotColor,"#2563EB")),Ue(e,o,"matrix")}function qt(e,o){e["--cfm-csat-emoji-size"]=`${h(o.emojiSize,24)}px`,e["--cfm-csat-unselected-opacity"]=String(h(o.unselectedOpacity,.5)),e["--cfm-star-unselected-opacity"]=String(h(o.unselectedStarOpacity??o.unselectedOpacity,.5)),e["--cfm-csat-cell-size"]=`${h(o.cellSize,40)}px`,e["--cfm-csat-tooltip-bg"]=a(o.tooltipBg,"#1F2937"),e["--cfm-csat-accent"]=a(o.accentColor,e["--cfm-accent"]??"#00B5AD"),e["--cfm-matrix-row-width"]=`${h(o.rowLabelWidth,180)}px`,e["--cfm-slider-track"]=a(o.graphicsTrackColor,"#E5E7EB"),e["--cfm-slider-thumb"]=a(o.graphicsThumbColor,e["--cfm-accent"]??"#00B5AD"),Ue(e,o,"csat"),Oe(e,o)}function Wt(e,o){e["--cfm-star-color"]=a(o.starColor,"#F59E0B"),e["--cfm-badge-color"]=a(o.badgeColor,e["--cfm-primary"]??"#1A1F36"),e["--cfm-csat-emoji-size"]=`${h(o.emojiSize,24)}px`,e["--cfm-star-unselected-opacity"]=String(h(o.unselectedStarOpacity,.5)),e["--cfm-csat-unselected-opacity"]=String(h(o.unselectedStarOpacity,.5)),e["--cfm-matrix-row-width"]=`${h(o.rowLabelWidth,180)}px`,e["--cfm-slider-track"]=a(o.graphicsTrackColor,"#E5E7EB"),e["--cfm-slider-thumb"]=a(o.graphicsThumbColor,e["--cfm-primary"]??"#1A1F36"),Ue(e,o,"rating"),Oe(e,o)}function Xt(e,o){e["--cfm-slider-track"]=a(o.trackColor,e["--cfm-accent"]??"#00B5AD"),e["--cfm-slider-thumb"]=a(o.thumbColor,e["--cfm-primary"]??"#1A1F36"),e["--cfm-slider-tick"]=a(o.tickColor,"#9CA3AF"),e["--cfm-matrix-row-width"]=`${h(o.rowLabelWidth,180)}px`,e["--cfm-slider-row-band"]=a(o.rowBandColor,e["--cfm-row-band"]??"#F3F4F6"),e["--cfm-slider-tick-size"]=`${h(o.tickBadgeSize,28)}px`,Ue(e,o,"slider"),Bo(e,o),Oe(e,o)}function Ht(e,o){e["--cfm-upload-border-color"]=a(o.borderColor??o.accentColor,"#D1D5DB"),e["--cfm-upload-padding"]=`${h(o.dropzonePadding,24)}px`,e["--cfm-upload-fill"]=a(o.dropzoneFillColor,"#F9FAFB"),e["--cfm-upload-border-style"]=a(o.dropzoneStyle,"dashed")}function Vt(e,o){e["--cfm-media-max-width"]=`${h(o.mediaMaxWidth,100)}%`,e["--cfm-media-radius"]=`${h(o.mediaRadius,8)}px`,e["--cfm-media-caption-color"]=a(o.captionColor,"#6B7280"),e["--cfm-media-caption-size"]=`${h(o.captionSize,14)}px`}function Jt(e,o){e["--cfm-heatmap-pin"]=a(o.pinColor,e["--cfm-accent"]??"#00B5AD"),e["--cfm-heatmap-pin-size"]=`${h(o.pinSize,12)}px`,e["--cfm-heatmap-pin-border"]=a(o.pinBorderColor,"#FFFFFF"),e["--cfm-heatmap-overlay-opacity"]=String(h(o.overlayOpacity,0))}function Gt(e,o){let t=X(o.drag)??o,n=X(o.dropdown)??t;e["--cfm-rank-item-bg"]=a(t.itemBg,"#F9FAFB"),e["--cfm-rank-badge-bg"]=a(t.rankBadgeColor,e["--cfm-primary"]??"#1A1F36"),e["--cfm-rank-badge-text"]="#ffffff",e["--cfm-rank-badge"]=a(t.rankBadgeColor,e["--cfm-primary"]??"#1A1F36"),e["--cfm-rank-item-padding"]=`${h(t.itemPadding,12)}px`,e["--cfm-rank-item-gap"]=`${h(t.itemGap,8)}px`,e["--cfm-rank-handle"]=a(t.dragHandleColor,"#9CA3AF"),e["--cfm-rank-select-border"]=a(n.selectBorderColor,"#E5E7EB")}function ze(e){let o=X(e.global)??{},t=X(o.colorScheme)??{},n=X(o.header)??{},r=X(o.footer)??{},i=X(o.theme)??{},s=X(o.layout)??{},c=X(o.typography)??{},d=X(o.motion)??{},g=e.questionTypes??{},b=a(s.fontStyle,"modern"),S=Mo[b]??a(c.fontFamily,Mo.modern),x=a(s.width,"standard"),F=a(s.borderStyle,"rounded"),k=a(i.cellSelectedColor,a(t.accent,"#00B5AD")),$=a(i.focusRingColor,a(t.accent,"#00B5AD")),f=a(i.selectedBackground,a(t.secondary,"#E8F5FD")),y={"--cfm-primary":a(t.primary,"#1A1F36"),"--cfm-secondary":a(t.secondary,"#E8F5FD"),"--cfm-accent":a(t.accent,"#00B5AD"),"--cfm-background":a(i.pageBackground??t.background,"#FFFFFF"),"--cfm-text":a(t.text,"#1A1F36"),"--cfm-button-text":a(t.buttonText,"#FFFFFF"),"--cfm-max-width":vo[x]??vo.standard,"--cfm-border-radius":Lo[F]??Lo.rounded,"--cfm-font-family":S,"--cfm-heading-weight":String(h(c.headingWeight,700)),"--cfm-motion-duration":`${h(d.durationMs,200)}ms`,"--cfm-header-height":`${h(n.height,120)}px`,"--cfm-header-logo-width":`${h(n.logoBoxWidth,120)}px`,"--cfm-header-logo-height":`${h(n.logoBoxHeight,120)}px`,"--cfm-header-logo-padding":`${h(n.logoPadding,10)}px`,"--cfm-header-show-company":n.showCompanyName===!1?"0":"1","--cfm-header-bg":a(n.backgroundColor,"#FFFFFF"),"--cfm-header-company-color":a(n.companyNameColor,a(t.text,"#1A1F36")),"--cfm-header-company-size":`${h(n.companyNameFontSize,18)}px`,"--cfm-header-company-weight":String(h(n.companyNameFontWeight,600)),"--cfm-header-border":a(n.borderBottomColor,"#E5E7EB"),"--cfm-header-padding-x":`${h(n.contentPaddingX,40)}px`,"--cfm-header-shadow":n.shadowEnabled===!1?"none":"0 2px 8px rgba(0,0,0,0.06)",...Lt(),"--cfm-footer-bg":a(r.backgroundColor,"#262626"),"--cfm-footer-text":a(r.textColor,"#9CA3AF"),"--cfm-footer-link":a(r.linkColor,"#9CA3AF"),"--cfm-footer-link-hover":a(r.linkHoverColor,"#FFFFFF"),"--cfm-footer-logo-width":`${h(r.logoWidth,120)}px`,"--cfm-footer-logo-height":`${h(r.logoHeight,32)}px`,"--cfm-footer-padding-y":`${h(r.paddingY,24)}px`,"--cfm-footer-padding-x":`${h(r.paddingX,40)}px`,...Mt(),"--cfm-card-bg":a(i.cardBackground,"#FFFFFF"),"--cfm-card-border-color":a(i.cardBorderColor,"#E5E7EB"),"--cfm-card-padding":`${h(i.cardPadding,24)}px`,"--cfm-card-gap":"32px","--cfm-card-shadow":i.cardShadowEnabled===!1?"none":`0 ${h(i.cardShadowOffsetY,1)}px ${h(i.cardShadowBlur,3)}px ${a(i.cardShadowColor,"rgba(0,0,0,0.1)")}`,"--cfm-selected-bg":f,"--cfm-mcq-selected-accent":$,"--cfm-mcq-selected-bg":f,"--cfm-matrix-selected":k,"--cfm-csat-ring-color":k,"--cfm-input-focus-ring":$,"--cfm-zebra-row":a(i.zebraRowColor,"rgba(249,250,251,0.8)"),"--cfm-row-band":a(i.rowBandColor,"#F3F4F6"),"--cfm-validation-border":a(i.validationBorder,"#333333"),"--cfm-validation-bg":a(i.validationBackground,"#D9D9D9"),"--cfm-tooltip-bg":a(i.tooltipBackground,"#1F2937"),"--cfm-progress-height":`${h(i.progressTrackHeight,12)}px`,"--cfm-progress-track":a(i.progressTrackColor,"#E5E7EB"),"--cfm-progress-fill":a(i.progressFillColor,a(t.primary,"#1A1F36")),"--cfm-sticky-pt":`${h(i.stickyChromePaddingTop,16)}px`,"--cfm-sticky-pb":`${h(i.stickyChromePaddingBottom,20)}px`,"--cfm-language-bg":a(i.languageSelectorBackground,"#FFFFFF"),"--cfm-language-text":a(i.languageSelectorTextColor,"#2563EB"),"--cfm-language-border":a(i.languageSelectorBorderColor,"#2563EB")},T=[["MCQ",Bt],["TEXTFIELD",Ot],["NPS_SCALE",Ut],["CFM_MATRIX",zt],["CSAT_MATRIX",qt],["RATING_MATRIX",Wt],["SLIDER_MATRIX",Xt],["FILE_UPLOAD",Ht],["TEXT_AND_MEDIA",Vt],["HEATMAP",Jt],["RANK_ORDER",Gt]];for(let[R,w]of T){let P=X(g[R]);P&&w(y,P)}return y}function to(e){let o=e.questionTypes??{},t=X(o.MCQ),n=X(o.NPS_SCALE),r=X(o.FILE_UPLOAD),i={};return i["data-cfm-mcq-style"]=a(t?.optionStyle??t?.cardStyle,"outlined"),n?.buttonStyle&&(i["data-cfm-nps-button-style"]=a(n.buttonStyle,"standard")),r?.dropzoneStyle&&(i["data-cfm-dropzone-style"]=a(r.dropzoneStyle,"dashed")),i}var vo,Lo,Mo,no=q(()=>{"use strict";vo={narrow:"36rem",standard:"48rem",wide:"64rem"},Lo={sharp:"0px",rounded:"12px",pill:"9999px"},Mo={system:'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',inter:"Inter, system-ui, sans-serif",modern:"Inter, sans-serif",roboto:"Roboto, system-ui, sans-serif",openSans:'"Open Sans", system-ui, sans-serif',lato:"Lato, system-ui, sans-serif",poppins:"Poppins, system-ui, sans-serif",montserrat:"Montserrat, system-ui, sans-serif",nunito:"Nunito, system-ui, sans-serif",raleway:"Raleway, system-ui, sans-serif",sourceSans:'"Source Sans 3", system-ui, sans-serif',georgia:'Georgia, "Times New Roman", serif',serif:"Georgia, serif",merriweather:"Merriweather, Georgia, serif",playfair:'"Playfair Display", Georgia, serif'}});function Qt(e){return`:root {
|
|
2
|
+
"use strict";var dt=Object.create;var Ve=Object.defineProperty;var ft=Object.getOwnPropertyDescriptor;var ut=Object.getOwnPropertyNames;var pt=Object.getPrototypeOf,gt=Object.prototype.hasOwnProperty;var q=(e,o)=>()=>(e&&(o=e(e=0)),o);var Ne=(e,o)=>{for(var t in o)Ve(e,t,{get:o[t],enumerable:!0})},mt=(e,o,t,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let r of ut(o))!gt.call(e,r)&&r!==t&&Ve(e,r,{get:()=>o[r],enumerable:!(n=ft(o,r))||n.enumerable});return e};var A=(e,o,t)=>(t=e!=null?dt(pt(e)):{},mt(o||!e||!e.__esModule?Ve(t,"default",{value:e,enumerable:!0}):t,e));var l,W=q(()=>{"use strict";l={reset:"\x1B[0m",bold:"\x1B[1m",green:"\x1B[32m",red:"\x1B[31m",cyan:"\x1B[36m",yellow:"\x1B[33m",dim:"\x1B[2m"}});var G,Te=q(()=>{"use strict";G=["MCQ","TEXTFIELD","NPS_SCALE","CFM_MATRIX","CSAT_MATRIX","RATING_MATRIX","SLIDER_MATRIX","FILE_UPLOAD","TEXT_AND_MEDIA","HEATMAP","RANK_ORDER"]});function wt(e){let o={};for(let t of e)yo[t]&&(o[t]={...yo[t]});return o}function bt(e=[],o){return{version:"1.0",instanceId:o,surveyTypes:e,global:{surveyTitle:"Customer Feedback Survey",companyName:"Sprinklr",browserTabTitle:"Customer Feedback Survey",thankYouMessage:"Thank you for your valuable feedback!",logo:{fileName:null,url:null},header:{height:120,logoBoxWidth:120,logoBoxHeight:120,logoPadding:10,logoPlacement:"left",showCompanyName:!0,companyNamePlacement:"left",companyNameFontSize:18,companyNameFontWeight:600,companyNameColor:"#1A1F36",backgroundColor:"#FFFFFF",shadowEnabled:!0,borderBottomColor:"#E5E7EB",contentPaddingX:40},footer:{backgroundColor:"#262626",textColor:"#9CA3AF",linkColor:"#9CA3AF",linkHoverColor:"#FFFFFF",showLogo:!0,logoWidth:120,logoHeight:32,logoPlacement:"left",copyrightText:"\xA9 Company Name",layout:"row",paddingY:21,paddingX:40,links:[]},theme:{pageBackground:"#FFFFFF",cardBackground:"#FFFFFF",cardBorderColor:"#E5E7EB",cardPadding:24,cardShadowEnabled:!0,selectedBackground:"#E8F5FD",zebraRowColor:"rgba(249,250,251,0.8)",rowBandColor:"#F3F4F6",validationBorder:"#333333",validationBackground:"#D9D9D9",tooltipBackground:"#1F2937",progressTrackHeight:12,progressTrackColor:"#E5E7EB",progressFillColor:"#1A1F36",stickyChromePaddingTop:16,stickyChromePaddingBottom:20,languageSelectorBackground:"#FFFFFF",languageSelectorTextColor:"#2563EB",languageSelectorBorderColor:"#2563EB"},layout:{showHeader:!0,showFooter:!0,showProgressBar:!0,showLanguageSwitcher:!1,showNextButton:!0,showBackButton:!0,showQuestionNumbers:!0,showRequiredAsterisk:!0,width:"standard",borderStyle:"rounded",fontStyle:"modern"},buttons:{next:"Next",back:"Back",submit:"Submit"},colorScheme:{...L},colorSource:"auto",typography:{fontFamily:"Inter, sans-serif",headingWeight:700},motion:{enabled:!1,durationMs:200}},questionTypes:wt(e),placeholders:{firstName:"Alex",lastName:"Customer",email:"alex@example.com"},customFields:{},debug:{enabled:!1,sampleAnswers:{}},deploy:{target:"aws",autoDeploy:!1}}}function ee(e,o){return{...e,...o??{}}}function De(e){let o=(e.surveyTypes??[]).filter(c=>G.includes(c)),t=[...new Set([...o,...G])],n=bt(t,e.instanceId),r=e.global??{},i=n.global,s={...n.questionTypes};if(e.questionTypes)for(let[c,d]of Object.entries(e.questionTypes))s[c]={...s[c]??{},...d};return{...n,...e,configuredAt:void 0,surveyTypes:o.length?o:n.surveyTypes,global:{...i,...r,header:ee(i.header,r.header),footer:ee(i.footer,r.footer),theme:ee(i.theme,r.theme),layout:ee(i.layout,r.layout),buttons:ee(i.buttons,r.buttons),logo:ee(i.logo,r.logo),colorScheme:ee(i.colorScheme,r.colorScheme),typography:ee(i.typography,r.typography),motion:ee(i.motion,r.motion)},questionTypes:s,placeholders:{...n.placeholders,...e.placeholders??{}},customFields:{...n.customFields,...e.customFields??{}},debug:{enabled:e.debug?.enabled??n.debug?.enabled??!1,sampleAnswers:e.debug?.sampleAnswers??n.debug?.sampleAnswers},deploy:{...n.deploy,...e.deploy??{}}}}var L,yo,Je=q(()=>{"use strict";Te();L={primary:"#1A1F36",secondary:"#E8F5FD",accent:"#00B5AD",background:"#FFFFFF",text:"#1A1F36",buttonText:"#FFFFFF"},yo={MCQ:{cardStyle:"outlined",selectedAccent:L.accent,optionGap:8,borderRadius:8,cardPadding:12,selectedBackground:L.secondary,hoverBorderColor:L.accent},TEXTFIELD:{inputRadius:8,focusRing:L.accent,borderColor:"#E5E7EB",inputPadding:12,inputHeight:44,placeholderColor:"#9CA3AF"},NPS_SCALE:{buttonStyle:"standard",selectedFill:L.secondary,labelColor:L.text,trackBarColor:"#F2F2F2",trackHighlightColor:"#FBE8F3",cellSize:40,cellGap:4},CFM_MATRIX:{rowLabelWidth:180,cellSelectedColor:L.accent,headerStyle:"bold",bipolarColumnWidthPercent:25,carouselDotColor:"#2563EB",cellPadding:8},CSAT_MATRIX:{rowLabelWidth:180,cellSelectedColor:L.accent,headerStyle:"bold",bipolarColumnWidthPercent:25,carouselDotColor:L.primary,cellPadding:8,accentColor:L.accent,emojiSize:24,unselectedOpacity:.5,selectedRingColor:L.accent,cellSize:40,tooltipBg:"#1F2937",graphicsTrackColor:"#E5E7EB",graphicsThumbColor:L.accent},RATING_MATRIX:{starColor:"#F59E0B",badgeColor:L.primary,rowLabelWidth:180,unselectedStarOpacity:.5,graphicsTrackColor:"#E5E7EB",graphicsThumbColor:L.primary},SLIDER_MATRIX:{trackColor:L.accent,thumbColor:L.primary,tickColor:"#9CA3AF",rowLabelWidth:180,rowBandColor:"#F3F4F6",tickBadgeSize:28,hintMinText:"Label 1",hintMaxText:"Label 2",hintLabelColor:"#6B7280",hintLabelBgColor:"transparent"},FILE_UPLOAD:{dropzoneStyle:"dashed",accentColor:L.accent,dropzonePadding:24},TEXT_AND_MEDIA:{mediaMaxWidth:100,mediaRadius:8,captionColor:"#6B7280",captionSize:14},HEATMAP:{pinColor:L.accent,pinSize:12,pinBorderColor:"#FFFFFF",overlayOpacity:.3},RANK_ORDER:{drag:{itemBg:"#F9FAFB",dragHandleColor:"#9CA3AF",rankBadgeColor:L.primary,itemPadding:12,itemGap:8},dropdown:{itemBg:"#F9FAFB",selectBorderColor:"#E5E7EB",rankBadgeColor:L.primary,itemPadding:12,itemGap:8}}}});function Co(e){let o={},t=/--cfm-[\w-]+\s*:\s*([^;]+);/g,n;for(;(n=t.exec(e))!==null;){let r=n[0].split(":")[0].trim(),i=n[1].trim();o[r]=i}return o}function E(e){if(!e)return;let o=parseFloat(e.replace(/px$/,""));return Number.isFinite(o)?o:void 0}function So(e){if(!e)return;let o=parseFloat(e.replace(/%$/,""));return Number.isFinite(o)?o:void 0}function xe(e){if(!e)return;let o=parseFloat(e);return Number.isFinite(o)?o:void 0}function To(e){let o={global:{},questionTypes:{}},t=o.global,n={},r={},i={},s={},c={},d={},g={},b=o.questionTypes;if(e["--cfm-primary"]&&(n.primary=e["--cfm-primary"]),e["--cfm-secondary"]&&(n.secondary=e["--cfm-secondary"]),e["--cfm-accent"]&&(n.accent=e["--cfm-accent"]),e["--cfm-background"]&&(n.background=e["--cfm-background"]),e["--cfm-text"]&&(n.text=e["--cfm-text"]),e["--cfm-button-text"]&&(n.buttonText=e["--cfm-button-text"]),e["--cfm-max-width"]&&ho[e["--cfm-max-width"]]&&(c.width=ho[e["--cfm-max-width"]]),e["--cfm-border-radius"]&&wo[e["--cfm-border-radius"]]&&(c.borderStyle=wo[e["--cfm-border-radius"]]),e["--cfm-font-family"]&&(d.fontFamily=e["--cfm-font-family"],bo[e["--cfm-font-family"]]&&(c.fontStyle=bo[e["--cfm-font-family"]])),e["--cfm-heading-weight"]&&(d.headingWeight=xe(e["--cfm-heading-weight"])),e["--cfm-motion-duration"]){let O=E(e["--cfm-motion-duration"]);O!==void 0&&(g.durationMs=O,g.enabled=O>0)}e["--cfm-header-height"]&&(r.height=E(e["--cfm-header-height"])),e["--cfm-header-logo-width"]&&(r.logoBoxWidth=E(e["--cfm-header-logo-width"])),e["--cfm-header-logo-height"]&&(r.logoBoxHeight=E(e["--cfm-header-logo-height"])),e["--cfm-header-logo-padding"]&&(r.logoPadding=E(e["--cfm-header-logo-padding"])),e["--cfm-header-bg"]&&(r.backgroundColor=e["--cfm-header-bg"]),e["--cfm-header-company-color"]&&(r.companyNameColor=e["--cfm-header-company-color"]),e["--cfm-header-company-size"]&&(r.companyNameFontSize=E(e["--cfm-header-company-size"])),e["--cfm-header-company-weight"]&&(r.companyNameFontWeight=xe(e["--cfm-header-company-weight"])),e["--cfm-header-border"]&&(r.borderBottomColor=e["--cfm-header-border"]),e["--cfm-header-padding-x"]&&(r.contentPaddingX=E(e["--cfm-header-padding-x"])),e["--cfm-footer-bg"]&&(i.backgroundColor=e["--cfm-footer-bg"]),e["--cfm-footer-text"]&&(i.textColor=e["--cfm-footer-text"]),e["--cfm-footer-link"]&&(i.linkColor=e["--cfm-footer-link"]),e["--cfm-footer-link-hover"]&&(i.linkHoverColor=e["--cfm-footer-link-hover"]),e["--cfm-footer-logo-width"]&&(i.logoWidth=E(e["--cfm-footer-logo-width"])),e["--cfm-footer-logo-height"]&&(i.logoHeight=E(e["--cfm-footer-logo-height"])),e["--cfm-footer-padding-y"]&&(i.paddingY=E(e["--cfm-footer-padding-y"])),e["--cfm-footer-padding-x"]&&(i.paddingX=E(e["--cfm-footer-padding-x"])),e["--cfm-background"]&&(s.pageBackground=e["--cfm-background"]),e["--cfm-card-bg"]&&(s.cardBackground=e["--cfm-card-bg"]),e["--cfm-card-border-color"]&&(s.cardBorderColor=e["--cfm-card-border-color"]),e["--cfm-card-padding"]&&(s.cardPadding=E(e["--cfm-card-padding"])),e["--cfm-card-shadow"]&&(s.cardShadowEnabled=e["--cfm-card-shadow"]!=="none"),e["--cfm-selected-bg"]&&(s.selectedBackground=e["--cfm-selected-bg"]),e["--cfm-zebra-row"]&&(s.zebraRowColor=e["--cfm-zebra-row"]),e["--cfm-row-band"]&&(s.rowBandColor=e["--cfm-row-band"]),e["--cfm-validation-border"]&&(s.validationBorder=e["--cfm-validation-border"]),e["--cfm-validation-bg"]&&(s.validationBackground=e["--cfm-validation-bg"]),e["--cfm-tooltip-bg"]&&(s.tooltipBackground=e["--cfm-tooltip-bg"]),e["--cfm-progress-height"]&&(s.progressTrackHeight=E(e["--cfm-progress-height"])),e["--cfm-progress-track"]&&(s.progressTrackColor=e["--cfm-progress-track"]),e["--cfm-progress-fill"]&&(s.progressFillColor=e["--cfm-progress-fill"]),e["--cfm-sticky-pt"]&&(s.stickyChromePaddingTop=E(e["--cfm-sticky-pt"])),e["--cfm-sticky-pb"]&&(s.stickyChromePaddingBottom=E(e["--cfm-sticky-pb"]));let S={};e["--cfm-mcq-selected-accent"]&&(S.selectedAccent=e["--cfm-mcq-selected-accent"]),e["--cfm-mcq-border-radius"]&&(S.borderRadius=E(e["--cfm-mcq-border-radius"])),e["--cfm-mcq-option-gap"]&&(S.optionGap=E(e["--cfm-mcq-option-gap"])),e["--cfm-mcq-card-padding"]&&(S.cardPadding=E(e["--cfm-mcq-card-padding"])),e["--cfm-mcq-selected-bg"]&&(S.selectedBackground=e["--cfm-mcq-selected-bg"]),e["--cfm-mcq-hover-border"]&&(S.hoverBorderColor=e["--cfm-mcq-hover-border"]),Object.keys(S).length&&(b.MCQ=S);let x={};e["--cfm-input-radius"]&&(x.inputRadius=E(e["--cfm-input-radius"])),e["--cfm-input-focus-ring"]&&(x.focusRing=e["--cfm-input-focus-ring"]),e["--cfm-input-border"]&&(x.borderColor=e["--cfm-input-border"]),e["--cfm-input-padding"]&&(x.inputPadding=E(e["--cfm-input-padding"])),e["--cfm-input-height"]&&(x.inputHeight=E(e["--cfm-input-height"])),e["--cfm-input-placeholder"]&&(x.placeholderColor=e["--cfm-input-placeholder"]),Object.keys(x).length&&(b.TEXTFIELD=x);let F={};e["--cfm-nps-selected-fill"]&&(F.selectedFill=e["--cfm-nps-selected-fill"]),e["--cfm-nps-label-color"]&&(F.labelColor=e["--cfm-nps-label-color"]),e["--cfm-nps-track-bar"]&&(F.trackBarColor=e["--cfm-nps-track-bar"]),e["--cfm-nps-track-highlight"]&&(F.trackHighlightColor=e["--cfm-nps-track-highlight"]),e["--cfm-nps-cell-size"]&&(F.cellSize=E(e["--cfm-nps-cell-size"])),e["--cfm-nps-cell-gap"]&&(F.cellGap=E(e["--cfm-nps-cell-gap"])),Object.keys(F).length&&(b.NPS_SCALE=F);let k=E(e["--cfm-matrix-row-width"]),$={};k!==void 0&&($.rowLabelWidth=k),e["--cfm-matrix-selected"]&&($.cellSelectedColor=e["--cfm-matrix-selected"]),e["--cfm-matrix-bipolar-width"]&&($.bipolarColumnWidthPercent=So(e["--cfm-matrix-bipolar-width"])),e["--cfm-matrix-carousel-dot"]&&($.carouselDotColor=e["--cfm-matrix-carousel-dot"]),e["--cfm-matrix-cell-padding"]&&($.cellPadding=E(e["--cfm-matrix-cell-padding"])),Object.keys($).length&&(b.CFM_MATRIX=$);let f={...$};e["--cfm-csat-accent"]&&(f.accentColor=e["--cfm-csat-accent"]),e["--cfm-csat-emoji-size"]&&(f.emojiSize=E(e["--cfm-csat-emoji-size"])),e["--cfm-csat-unselected-opacity"]&&(f.unselectedOpacity=xe(e["--cfm-csat-unselected-opacity"])),e["--cfm-csat-ring-color"]&&(f.selectedRingColor=e["--cfm-csat-ring-color"]),e["--cfm-csat-cell-size"]&&(f.cellSize=E(e["--cfm-csat-cell-size"])),e["--cfm-csat-tooltip-bg"]&&(f.tooltipBg=e["--cfm-csat-tooltip-bg"]),(Object.keys(f).length>Object.keys($).length||e["--cfm-csat-accent"])&&(b.CSAT_MATRIX=f);let y={};e["--cfm-star-color"]&&(y.starColor=e["--cfm-star-color"]),e["--cfm-badge-color"]&&(y.badgeColor=e["--cfm-badge-color"]),k!==void 0&&(y.rowLabelWidth=k),e["--cfm-star-unselected-opacity"]&&(y.unselectedStarOpacity=xe(e["--cfm-star-unselected-opacity"])),Object.keys(y).length&&(b.RATING_MATRIX=y);let T={};e["--cfm-slider-track"]&&(T.trackColor=e["--cfm-slider-track"]),e["--cfm-slider-thumb"]&&(T.thumbColor=e["--cfm-slider-thumb"]),e["--cfm-slider-tick"]&&(T.tickColor=e["--cfm-slider-tick"]),k!==void 0&&(T.rowLabelWidth=k),e["--cfm-slider-row-band"]&&(T.rowBandColor=e["--cfm-slider-row-band"]),e["--cfm-slider-tick-size"]&&(T.tickBadgeSize=E(e["--cfm-slider-tick-size"])),Object.keys(T).length&&(b.SLIDER_MATRIX=T);let R={};e["--cfm-upload-accent"]&&(R.accentColor=e["--cfm-upload-accent"]),e["--cfm-upload-padding"]&&(R.dropzonePadding=E(e["--cfm-upload-padding"])),Object.keys(R).length&&(b.FILE_UPLOAD=R);let w={};e["--cfm-media-max-width"]&&(w.mediaMaxWidth=So(e["--cfm-media-max-width"])),e["--cfm-media-radius"]&&(w.mediaRadius=E(e["--cfm-media-radius"])),e["--cfm-media-caption-color"]&&(w.captionColor=e["--cfm-media-caption-color"]),e["--cfm-media-caption-size"]&&(w.captionSize=E(e["--cfm-media-caption-size"])),Object.keys(w).length&&(b.TEXT_AND_MEDIA=w);let P={};e["--cfm-heatmap-pin"]&&(P.pinColor=e["--cfm-heatmap-pin"]),e["--cfm-heatmap-pin-size"]&&(P.pinSize=E(e["--cfm-heatmap-pin-size"])),e["--cfm-heatmap-pin-border"]&&(P.pinBorderColor=e["--cfm-heatmap-pin-border"]),e["--cfm-heatmap-overlay-opacity"]&&(P.overlayOpacity=xe(e["--cfm-heatmap-overlay-opacity"])),Object.keys(P).length&&(b.HEATMAP=P);let C={};return e["--cfm-rank-item-bg"]&&(C.itemBg=e["--cfm-rank-item-bg"]),e["--cfm-rank-badge"]&&(C.rankBadgeColor=e["--cfm-rank-badge"]),e["--cfm-rank-handle"]&&(C.dragHandleColor=e["--cfm-rank-handle"]),e["--cfm-rank-item-padding"]&&(C.itemPadding=E(e["--cfm-rank-item-padding"])),e["--cfm-rank-item-gap"]&&(C.itemGap=E(e["--cfm-rank-item-gap"])),Object.keys(C).length&&(b.RANK_ORDER=C),Object.keys(n).length&&(t.colorScheme=n),Object.keys(r).length&&(t.header=r),Object.keys(i).length&&(t.footer=i),Object.keys(s).length&&(t.theme=s),Object.keys(c).length&&(t.layout=c),Object.keys(d).length&&(t.typography=d),Object.keys(g).length&&(t.motion=g),o}function ue(e){let o=[Re.join(e,"src","styles","survey-theme.css"),Re.join(e,"src","app","survey-theme.css"),Re.join(e,"src","styles","globals.css"),Re.join(e,"src","app","globals.css")];for(let t of o)if(ve.existsSync(t)&&ve.readFileSync(t,"utf8").includes("--cfm-"))return t;return null}var ve,Re,ho,wo,bo,Le=q(()=>{"use strict";ve=A(require("fs")),Re=A(require("path")),ho={"36rem":"narrow","48rem":"standard","64rem":"wide"},wo={"0px":"sharp","12px":"rounded","9999px":"pill"},bo={"system-ui, sans-serif":"system","Inter, sans-serif":"modern","Georgia, serif":"serif"}});function Ct(e){for(let o of St){let t=xo.join(e,o);if(Me.existsSync(t))return t}return null}function Tt(e){let o=e.trim();if(!o||o.startsWith("http")||o.startsWith("data:"))return null;let t=o.split("?")[0];return t.startsWith("/")?t.slice(1):t}function Ro(e){let o=Ct(e);if(!o)return null;let t=Me.readFileSync(o,"utf8"),n=t.match(/data-cfm-logo[\s\S]*?src=["']([^"']+)["']/i)??t.match(/src=["']([^"']+)["'][\s\S]*?data-cfm-logo/i);if(n){let s=Tt(n[1]);if(s)return{mode:"image",publicPath:s,fileName:s}}let r=t.match(/data-cfm-logo-text[^>]*>([^<]+)</i);if(r)return{mode:"text",label:r[1].trim()};let i=t.match(/data-cfm-company[^>]*>([^<]+)</i);return i&&!n?{mode:"text",label:i[1].trim()}:null}var Me,xo,St,$o=q(()=>{"use strict";Me=A(require("fs")),xo=A(require("path")),St=["src/components/Header.tsx","components/Header.tsx","app/components/Header.tsx"]});var Po={};Ne(Po,{logSeedSource:()=>Qe,resolveInitialConfig:()=>ge,writeResolvedUiConfig:()=>Ke});function Ge(e){return e.filter(o=>G.includes(o))}function Ao(e){try{let o=JSON.parse(Q.readFileSync(e,"utf8"));return o.version!=="1.0"?null:(delete o.configuredAt,o)}catch{return null}}function $t(e){let o={global:{}};if(!Q.existsSync(e))return o;let t=Q.readFileSync(e,"utf8"),n=new Set;for(let i of G)t.includes(i)&&n.add(i);n.size&&(o.surveyTypes=[...n]);let r=t.match(/\*\*Branding source:\*\*\s*(.+)/i);if(r){let i=r[1].trim(),s=i.match(/company[:\s]+([^,;]+)/i),c=i.match(/title[:\s]+([^,;]+)/i);if(s&&(o.global.companyName=s[1].trim()),c){let d=c[1].trim();o.global.surveyTitle=d,o.global.browserTabTitle=d}}return o}function Fo(e,o){let t=oe.join(e,o);if(!Q.existsSync(t))return null;let n=Q.readFileSync(t);if(n.length>xt)return{fileName:o,dataUrl:""};let r=oe.extname(o).toLowerCase(),i=Rt[r]??"application/octet-stream";return{fileName:o,dataUrl:`data:${i};base64,${n.toString("base64")}`}}function Eo(e,o){if(!o)return null;if(o.url&&typeof o.url=="string")return{fileName:o.fileName??null,url:o.url};if(o.fileName){let t=Fo(e,o.fileName);if(t)return{fileName:t.fileName,url:t.dataUrl||null}}return o.fileName===null&&o.url===null?{fileName:null,url:null}:null}function ko(e,o){let t=e.global??{},n=o.global??{},r=e.questionTypes??{},i=o.questionTypes??{},s={...r};for(let[c,d]of Object.entries(i))s[c]={...s[c]??{},...d};return{...e,...o,surveyTypes:o.surveyTypes??e.surveyTypes,global:{...t,...n,header:{...t.header,...n.header},footer:{...t.footer,...n.footer},theme:{...t.theme,...n.theme},layout:{...t.layout,...n.layout},buttons:{...t.buttons,...n.buttons},logo:{...t.logo,...n.logo},colorScheme:{...t.colorScheme,...n.colorScheme},typography:{...t.typography,...n.typography},motion:{...t.motion,...n.motion}},questionTypes:s,placeholders:{...e.placeholders,...o.placeholders},customFields:{...e.customFields,...o.customFields},deploy:{...e.deploy,...o.deploy}}}function ge(e){let o=e.projectRoot??process.env.INIT_CWD??process.cwd(),t=oe.join(o,"survey-ui-config.json"),n=oe.join(o,"implementation_plan.md"),r=oe.join(o,"public"),i=Ge(e.surveyTypes),s={},c="defaults",d=ue(o);if(d){let C=Q.readFileSync(d,"utf8"),O=Co(C);Object.keys(O).length>0&&(s=To(O),c="survey-theme.css")}let g=$t(n);s=ko(s,g);let b=Ao(t);b&&(s=ko(s,b),c="survey-ui-config.json");let S=oe.join(o,"survey-ui-config.final.json"),x=Ao(S),F=!!b?.configuredAt,k=!!x?.configuredAt;if(x&&k&&!F){let C=Eo(r,x.global?.logo);C&&(s.global={...s.global??{},logo:{fileName:C.fileName,url:C.url}})}let $=Eo(r,s.global?.logo),f=Ro(o),y=!!b?.configuredAt,T=$?.fileName!=null&&/^logo_\d+_/i.test($.fileName),R=f?.mode==="image"?f.fileName:null,w=!y&&T&&R!=null&&$?.fileName!==R;if($&&!w)s.global={...s.global??{},logo:{fileName:$.fileName,url:$.url}};else if(f?.mode==="image"){let C=Fo(r,f.fileName);s.global={...s.global??{},logo:{fileName:f.fileName,url:C?.dataUrl||null}}}else f?.mode==="text"&&(s.global={...s.global??{},logo:{fileName:null,url:null},companyName:s.global?.companyName??f.label});return s.surveyTypes=Ge(s.surveyTypes??i),s.surveyTypes?.length||(s.surveyTypes=i),e.instanceId&&(s.instanceId=e.instanceId),{config:De(s),source:c}}function Qe(e){console.log(e==="survey-ui-config.json"?`${pe.dim} Seeding wizard from survey-ui-config.json${pe.reset}`:e==="survey-theme.css"?`${pe.dim} Seeding wizard from survey-theme.css + defaults${pe.reset}`:`${pe.dim} Seeding wizard from SDK defaults${pe.reset}`)}function Ke(e={}){let o=e.projectRoot??process.env.INIT_CWD??process.cwd(),t=e.surveyTypes??Ge(G),{config:n}=ge({projectRoot:o,surveyTypes:t,instanceId:e.instanceId}),r=oe.join(o,"survey-ui-config.json");return Q.writeFileSync(r,JSON.stringify(n,null,2),"utf8"),r}var Q,oe,pe,xt,Rt,$e=q(()=>{"use strict";Q=A(require("fs")),oe=A(require("path"));W();Je();Le();Te();$o();pe=l,xt=512e3,Rt={".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".svg":"image/svg+xml"}});function X(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function h(e,o){return typeof e=="number"&&Number.isFinite(e)?e:o}function a(e,o){return typeof e=="string"&&e.length?e:o}function Lt(){return{"--cfm-header-brand-gap":"16px","--cfm-header-padding-y":"12px","--cfm-header-company-margin-top":"0","--cfm-header-company-margin-left":"0","--cfm-header-company-margin-right":"0","--cfm-header-logo-col":"1","--cfm-header-logo-justify":"start"}}function Mt(){return{"--cfm-footer-inner-display":"grid","--cfm-footer-inner-direction":"row","--cfm-footer-logo-col":"1","--cfm-footer-logo-justify":"start","--cfm-footer-links-col":"3","--cfm-footer-links-justify":"end","--cfm-footer-logo-copyright-gap":"12px"}}function Oe(e,o){o.numberLabelMode&&(e["--cfm-number-label-mode"]=a(o.numberLabelMode,"traffic")),o.monochromeNumberColor&&(e["--cfm-number-mono-color"]=a(o.monochromeNumberColor,"#9CA3AF"));let t=o.individualNumberColors;Array.isArray(t)&&t.forEach((n,r)=>{typeof n=="string"&&(e[`--cfm-number-color-${r}`]=n)})}function Bo(e,o){o.hintLabelColor&&(e["--cfm-hint-label-color"]=a(o.hintLabelColor,"#6B7280")),o.hintLabelBgColor&&(e["--cfm-hint-label-bg"]=a(o.hintLabelBgColor,"transparent"))}function Ue(e,o,t){(t==="matrix"||t==="csat")&&(o.columnLabelColor&&(e["--cfm-matrix-column-label-color"]=a(o.columnLabelColor,"#4B5563")),o.columnLabelBgColor&&(e["--cfm-matrix-column-label-bg"]=a(o.columnLabelBgColor,"transparent"))),t==="csat"&&(o.columnLabelColor&&(e["--cfm-csat-column-label-color"]=a(o.columnLabelColor,"#4B5563")),o.columnLabelBgColor&&(e["--cfm-csat-column-label-bg"]=a(o.columnLabelBgColor,"transparent"))),t==="rating"&&(o.columnLabelColor&&(e["--cfm-rating-column-label-color"]=a(o.columnLabelColor,"#4B5563")),o.columnLabelBgColor&&(e["--cfm-rating-column-label-bg"]=a(o.columnLabelBgColor,"transparent"))),t==="slider"&&(o.columnLabelColor&&(e["--cfm-slider-tick-label-color"]=a(o.columnLabelColor,"#4B5563")),o.columnLabelBgColor&&(e["--cfm-slider-tick-label-bg"]=a(o.columnLabelBgColor,"transparent")))}function Bt(e,o){let t=a(o.optionStyle??o.cardStyle,"outlined");e["--cfm-mcq-border-radius"]=`${h(o.borderRadius,8)}px`,e["--cfm-mcq-option-gap"]=`${h(o.optionGap,8)}px`,e["--cfm-mcq-card-padding"]=`${h(o.optionPadding??o.cardPadding,12)}px`,e["--cfm-mcq-hover-border"]=a(o.hoverBorderColor,"#00B5AD"),e["--cfm-mcq-option-style"]=t,o.filledOptionBg&&(e["--cfm-mcq-filled-bg"]=a(o.filledOptionBg,"#F9FAFB"))}function Ot(e,o){e["--cfm-input-radius"]=`${h(o.inputRadius,8)}px`,e["--cfm-input-border"]=a(o.borderColor,"#E5E7EB"),e["--cfm-input-padding"]=`${h(o.inputPadding,12)}px`,e["--cfm-input-height"]=`${h(o.inputHeight,44)}px`,e["--cfm-input-placeholder"]=a(o.placeholderColor,"#9CA3AF")}function Ut(e,o){e["--cfm-nps-cell-size"]=`${h(o.cellSize,40)}px`,e["--cfm-nps-cell-gap"]=`${h(o.cellGap,4)}px`,e["--cfm-nps-button-style"]=a(o.buttonStyle,"standard"),e["--cfm-nps-selected-fill"]=a(o.selectedFill,"#E8F5FD"),e["--cfm-nps-track-bar"]=a(o.trackBarColor,"#F2F2F2"),e["--cfm-nps-track-highlight"]=a(o.trackHighlightColor,"#FBE8F3"),Bo(e,o),Oe(e,o)}function zt(e,o){e["--cfm-matrix-row-width"]=`${h(o.rowLabelWidth,180)}px`,e["--cfm-matrix-bipolar-width"]=`${h(o.bipolarColumnWidthPercent,25)}%`,e["--cfm-matrix-cell-padding"]=`${h(o.cellPadding,8)}px`,o.carouselDotColor&&(e["--cfm-matrix-carousel-dot"]=a(o.carouselDotColor,"#2563EB")),Ue(e,o,"matrix")}function qt(e,o){e["--cfm-csat-emoji-size"]=`${h(o.emojiSize,24)}px`,e["--cfm-csat-unselected-opacity"]=String(h(o.unselectedOpacity,.5)),e["--cfm-star-unselected-opacity"]=String(h(o.unselectedStarOpacity??o.unselectedOpacity,.5)),e["--cfm-csat-cell-size"]=`${h(o.cellSize,40)}px`,e["--cfm-csat-tooltip-bg"]=a(o.tooltipBg,"#1F2937"),e["--cfm-csat-accent"]=a(o.accentColor,e["--cfm-accent"]??"#00B5AD"),e["--cfm-matrix-row-width"]=`${h(o.rowLabelWidth,180)}px`,e["--cfm-slider-track"]=a(o.graphicsTrackColor,"#E5E7EB"),e["--cfm-slider-thumb"]=a(o.graphicsThumbColor,e["--cfm-accent"]??"#00B5AD"),Ue(e,o,"csat"),Oe(e,o)}function Wt(e,o){e["--cfm-star-color"]=a(o.starColor,"#F59E0B"),e["--cfm-badge-color"]=a(o.badgeColor,e["--cfm-primary"]??"#1A1F36"),e["--cfm-csat-emoji-size"]=`${h(o.emojiSize,24)}px`,e["--cfm-star-unselected-opacity"]=String(h(o.unselectedStarOpacity,.5)),e["--cfm-csat-unselected-opacity"]=String(h(o.unselectedStarOpacity,.5)),e["--cfm-matrix-row-width"]=`${h(o.rowLabelWidth,180)}px`,e["--cfm-slider-track"]=a(o.graphicsTrackColor,"#E5E7EB"),e["--cfm-slider-thumb"]=a(o.graphicsThumbColor,e["--cfm-primary"]??"#1A1F36"),Ue(e,o,"rating"),Oe(e,o)}function Xt(e,o){e["--cfm-slider-track"]=a(o.trackColor,e["--cfm-accent"]??"#00B5AD"),e["--cfm-slider-thumb"]=a(o.thumbColor,e["--cfm-primary"]??"#1A1F36"),e["--cfm-slider-tick"]=a(o.tickColor,"#9CA3AF"),e["--cfm-matrix-row-width"]=`${h(o.rowLabelWidth,180)}px`,e["--cfm-slider-row-band"]=a(o.rowBandColor,e["--cfm-row-band"]??"#F3F4F6"),e["--cfm-slider-tick-size"]=`${h(o.tickBadgeSize,28)}px`,Ue(e,o,"slider"),Bo(e,o),Oe(e,o)}function Ht(e,o){e["--cfm-upload-border-color"]=a(o.borderColor??o.accentColor,"#D1D5DB"),e["--cfm-upload-padding"]=`${h(o.dropzonePadding,24)}px`,e["--cfm-upload-fill"]=a(o.dropzoneFillColor,"#F9FAFB"),e["--cfm-upload-border-style"]=a(o.dropzoneStyle,"dashed")}function Vt(e,o){e["--cfm-media-max-width"]=`${h(o.mediaMaxWidth,100)}%`,e["--cfm-media-radius"]=`${h(o.mediaRadius,8)}px`,e["--cfm-media-caption-color"]=a(o.captionColor,"#6B7280"),e["--cfm-media-caption-size"]=`${h(o.captionSize,14)}px`}function Jt(e,o){e["--cfm-heatmap-pin"]=a(o.pinColor,e["--cfm-accent"]??"#00B5AD"),e["--cfm-heatmap-pin-size"]=`${h(o.pinSize,12)}px`,e["--cfm-heatmap-pin-border"]=a(o.pinBorderColor,"#FFFFFF"),e["--cfm-heatmap-overlay-opacity"]=String(h(o.overlayOpacity,0))}function Gt(e,o){let t=X(o.drag)??o,n=X(o.dropdown)??t;e["--cfm-rank-item-bg"]=a(t.itemBg,"#F9FAFB"),e["--cfm-rank-badge-bg"]=a(t.rankBadgeColor,e["--cfm-primary"]??"#1A1F36"),e["--cfm-rank-badge-text"]="#ffffff",e["--cfm-rank-badge"]=a(t.rankBadgeColor,e["--cfm-primary"]??"#1A1F36"),e["--cfm-rank-item-padding"]=`${h(t.itemPadding,12)}px`,e["--cfm-rank-item-gap"]=`${h(t.itemGap,8)}px`,e["--cfm-rank-handle"]=a(t.dragHandleColor,"#9CA3AF"),e["--cfm-rank-select-border"]=a(n.selectBorderColor,"#E5E7EB")}function ze(e){let o=X(e.global)??{},t=X(o.colorScheme)??{},n=X(o.header)??{},r=X(o.footer)??{},i=X(o.theme)??{},s=X(o.layout)??{},c=X(o.typography)??{},d=X(o.motion)??{},g=e.questionTypes??{},b=a(s.fontStyle,"modern"),S=Mo[b]??a(c.fontFamily,Mo.modern),x=a(s.width,"standard"),F=a(s.borderStyle,"rounded"),k=a(i.cellSelectedColor,a(t.accent,"#00B5AD")),$=a(i.focusRingColor,a(t.accent,"#00B5AD")),f=a(i.selectedBackground,a(t.secondary,"#E8F5FD")),y={"--cfm-primary":a(t.primary,"#1A1F36"),"--cfm-secondary":a(t.secondary,"#E8F5FD"),"--cfm-accent":a(t.accent,"#00B5AD"),"--cfm-background":a(i.pageBackground??t.background,"#FFFFFF"),"--cfm-text":a(t.text,"#1A1F36"),"--cfm-button-text":a(t.buttonText,"#FFFFFF"),"--cfm-max-width":vo[x]??vo.standard,"--cfm-border-radius":Lo[F]??Lo.rounded,"--cfm-font-family":S,"--cfm-heading-weight":String(h(c.headingWeight,700)),"--cfm-motion-duration":`${h(d.durationMs,200)}ms`,"--cfm-header-height":`${h(n.height,120)}px`,"--cfm-header-logo-width":`${h(n.logoBoxWidth,120)}px`,"--cfm-header-logo-height":`${h(n.logoBoxHeight,120)}px`,"--cfm-header-logo-padding":`${h(n.logoPadding,10)}px`,"--cfm-header-show-company":n.showCompanyName===!1?"0":"1","--cfm-header-bg":a(n.backgroundColor,"#FFFFFF"),"--cfm-header-company-color":a(n.companyNameColor,a(t.text,"#1A1F36")),"--cfm-header-company-size":`${h(n.companyNameFontSize,18)}px`,"--cfm-header-company-weight":String(h(n.companyNameFontWeight,600)),"--cfm-header-border":a(n.borderBottomColor,"#E5E7EB"),"--cfm-header-padding-x":`${h(n.contentPaddingX,40)}px`,"--cfm-header-shadow":n.shadowEnabled===!1?"none":"0 2px 8px rgba(0,0,0,0.06)",...Lt(),"--cfm-footer-bg":a(r.backgroundColor,"#262626"),"--cfm-footer-text":a(r.textColor,"#9CA3AF"),"--cfm-footer-link":a(r.linkColor,"#9CA3AF"),"--cfm-footer-link-hover":a(r.linkHoverColor,"#FFFFFF"),"--cfm-footer-logo-width":`${h(r.logoWidth,120)}px`,"--cfm-footer-logo-height":`${h(r.logoHeight,32)}px`,"--cfm-footer-padding-y":`${h(r.paddingY,24)}px`,"--cfm-footer-padding-x":`${h(r.paddingX,40)}px`,...Mt(),"--cfm-card-bg":a(i.cardBackground,"#FFFFFF"),"--cfm-card-border-color":a(i.cardBorderColor,"#E5E7EB"),"--cfm-card-padding":`${h(i.cardPadding,24)}px`,"--cfm-card-gap":"32px","--cfm-card-shadow":i.cardShadowEnabled===!1?"none":`0 ${h(i.cardShadowOffsetY,1)}px ${h(i.cardShadowBlur,3)}px ${a(i.cardShadowColor,"rgba(0,0,0,0.1)")}`,"--cfm-selected-bg":f,"--cfm-mcq-selected-accent":$,"--cfm-mcq-selected-bg":f,"--cfm-matrix-selected":k,"--cfm-csat-ring-color":k,"--cfm-input-focus-ring":$,"--cfm-zebra-row":a(i.zebraRowColor,"rgba(249,250,251,0.8)"),"--cfm-row-band":a(i.rowBandColor,"#F3F4F6"),"--cfm-validation-border":a(i.validationBorder,"#333333"),"--cfm-validation-bg":a(i.validationBackground,"#D9D9D9"),"--cfm-tooltip-bg":a(i.tooltipBackground,"#1F2937"),"--cfm-progress-height":`${h(i.progressTrackHeight,12)}px`,"--cfm-progress-track":a(i.progressTrackColor,"#E5E7EB"),"--cfm-progress-fill":a(i.progressFillColor,a(t.primary,"#1A1F36")),"--cfm-sticky-pt":`${h(i.stickyChromePaddingTop,16)}px`,"--cfm-sticky-pb":`${h(i.stickyChromePaddingBottom,20)}px`,"--cfm-language-bg":a(i.languageSelectorBackground,"#FFFFFF"),"--cfm-language-text":a(i.languageSelectorTextColor,"#2563EB"),"--cfm-language-border":a(i.languageSelectorBorderColor,"#2563EB")},T=[["MCQ",Bt],["TEXTFIELD",Ot],["NPS_SCALE",Ut],["CFM_MATRIX",zt],["CSAT_MATRIX",qt],["RATING_MATRIX",Wt],["SLIDER_MATRIX",Xt],["FILE_UPLOAD",Ht],["TEXT_AND_MEDIA",Vt],["HEATMAP",Jt],["RANK_ORDER",Gt]];for(let[R,w]of T){let P=X(g[R]);P&&w(y,P)}return y}function to(e){let o=e.questionTypes??{},t=X(o.MCQ),n=X(o.NPS_SCALE),r=X(o.FILE_UPLOAD),i={};return i["data-cfm-mcq-style"]=a(t?.optionStyle??t?.cardStyle,"outlined"),n?.buttonStyle&&(i["data-cfm-nps-button-style"]=a(n.buttonStyle,"standard")),r?.dropzoneStyle&&(i["data-cfm-dropzone-style"]=a(r.dropzoneStyle,"dashed")),i}var vo,Lo,Mo,no=q(()=>{"use strict";vo={narrow:"36rem",standard:"48rem",wide:"64rem"},Lo={sharp:"0px",rounded:"12px",pill:"9999px"},Mo={system:'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',inter:"Inter, system-ui, sans-serif",modern:"Inter, sans-serif",roboto:"Roboto, system-ui, sans-serif",openSans:'"Open Sans", system-ui, sans-serif',lato:"Lato, system-ui, sans-serif",poppins:"Poppins, system-ui, sans-serif",montserrat:"Montserrat, system-ui, sans-serif",nunito:"Nunito, system-ui, sans-serif",raleway:"Raleway, system-ui, sans-serif",sourceSans:'"Source Sans 3", system-ui, sans-serif',georgia:'Georgia, "Times New Roman", serif',serif:"Georgia, serif",merriweather:"Merriweather, Georgia, serif",playfair:'"Playfair Display", Georgia, serif'}});function Qt(e){return`:root {
|
|
3
3
|
${Object.entries(e).sort(([t],[n])=>t.localeCompare(n)).map(([t,n])=>` ${t}: ${n};`).join(`
|
|
4
4
|
`)}
|
|
5
5
|
}`}function Kt(e,o){let t=ze(e),n=Qt(t),r=o.match(/:root\s*\{[\s\S]*?\n\}/);return r?o.replace(r[0],n):`${n}
|
package/dist/cli/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var it=Object.defineProperty;var Pe=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(o,t)=>(typeof require<"u"?require:o)[t]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var z=(e,o)=>()=>(e&&(o=e(e=0)),o);var Ie=(e,o)=>{for(var t in o)it(e,t,{get:o[t],enumerable:!0})};var l,q=z(()=>{"use strict";l={reset:"\x1B[0m",bold:"\x1B[1m",green:"\x1B[32m",red:"\x1B[31m",cyan:"\x1B[36m",yellow:"\x1B[33m",dim:"\x1B[2m"}});var J,Se=z(()=>{"use strict";J=["MCQ","TEXTFIELD","NPS_SCALE","CFM_MATRIX","CSAT_MATRIX","RATING_MATRIX","SLIDER_MATRIX","FILE_UPLOAD","TEXT_AND_MEDIA","HEATMAP","RANK_ORDER"]});function pt(e){let o={};for(let t of e)uo[t]&&(o[t]={...uo[t]});return o}function gt(e=[],o){return{version:"1.0",instanceId:o,surveyTypes:e,global:{surveyTitle:"Customer Feedback Survey",companyName:"Sprinklr",browserTabTitle:"Customer Feedback Survey",thankYouMessage:"Thank you for your valuable feedback!",logo:{fileName:null,url:null},header:{height:120,logoBoxWidth:120,logoBoxHeight:120,logoPadding:10,logoPlacement:"left",showCompanyName:!0,companyNamePlacement:"left",companyNameFontSize:18,companyNameFontWeight:600,companyNameColor:"#1A1F36",backgroundColor:"#FFFFFF",shadowEnabled:!0,borderBottomColor:"#E5E7EB",contentPaddingX:40},footer:{backgroundColor:"#262626",textColor:"#9CA3AF",linkColor:"#9CA3AF",linkHoverColor:"#FFFFFF",showLogo:!0,logoWidth:120,logoHeight:32,logoPlacement:"left",copyrightText:"\xA9 Company Name",layout:"row",paddingY:24,paddingX:40,links:[]},theme:{pageBackground:"#FFFFFF",cardBackground:"#FFFFFF",cardBorderColor:"#E5E7EB",cardPadding:24,cardShadowEnabled:!0,selectedBackground:"#E8F5FD",zebraRowColor:"rgba(249,250,251,0.8)",rowBandColor:"#F3F4F6",validationBorder:"#333333",validationBackground:"#D9D9D9",tooltipBackground:"#1F2937",progressTrackHeight:12,progressTrackColor:"#E5E7EB",progressFillColor:"#1A1F36",stickyChromePaddingTop:16,stickyChromePaddingBottom:20,languageSelectorBackground:"#FFFFFF",languageSelectorTextColor:"#2563EB",languageSelectorBorderColor:"#2563EB"},layout:{showHeader:!0,showFooter:!0,showProgressBar:!0,showLanguageSwitcher:!1,showNextButton:!0,showBackButton:!0,showQuestionNumbers:!0,showRequiredAsterisk:!0,width:"standard",borderStyle:"rounded",fontStyle:"modern"},buttons:{next:"Next",back:"Back",submit:"Submit"},colorScheme:{...v},colorSource:"auto",typography:{fontFamily:"Inter, sans-serif",headingWeight:700},motion:{enabled:!1,durationMs:200}},questionTypes:pt(e),placeholders:{firstName:"Alex",lastName:"Customer",email:"alex@example.com"},customFields:{},debug:{enabled:!1,sampleAnswers:{}},deploy:{target:"aws",autoDeploy:!1}}}function Z(e,o){return{...e,...o??{}}}function _e(e){let o=(e.surveyTypes??[]).filter(c=>J.includes(c)),t=[...new Set([...o,...J])],n=gt(t,e.instanceId),r=e.global??{},i=n.global,s={...n.questionTypes};if(e.questionTypes)for(let[c,d]of Object.entries(e.questionTypes))s[c]={...s[c]??{},...d};return{...n,...e,configuredAt:void 0,surveyTypes:o.length?o:n.surveyTypes,global:{...i,...r,header:Z(i.header,r.header),footer:Z(i.footer,r.footer),theme:Z(i.theme,r.theme),layout:Z(i.layout,r.layout),buttons:Z(i.buttons,r.buttons),logo:Z(i.logo,r.logo),colorScheme:Z(i.colorScheme,r.colorScheme),typography:Z(i.typography,r.typography),motion:Z(i.motion,r.motion)},questionTypes:s,placeholders:{...n.placeholders,...e.placeholders??{}},customFields:{...n.customFields,...e.customFields??{}},debug:{enabled:e.debug?.enabled??n.debug?.enabled??!1,sampleAnswers:e.debug?.sampleAnswers??n.debug?.sampleAnswers},deploy:{...n.deploy,...e.deploy??{}}}}var v,uo,Xe=z(()=>{"use strict";Se();v={primary:"#1A1F36",secondary:"#E8F5FD",accent:"#00B5AD",background:"#FFFFFF",text:"#1A1F36",buttonText:"#FFFFFF"},uo={MCQ:{cardStyle:"outlined",selectedAccent:v.accent,optionGap:8,borderRadius:8,cardPadding:12,selectedBackground:v.secondary,hoverBorderColor:v.accent},TEXTFIELD:{inputRadius:8,focusRing:v.accent,borderColor:"#E5E7EB",inputPadding:12,inputHeight:44,placeholderColor:"#9CA3AF"},NPS_SCALE:{buttonStyle:"standard",selectedFill:v.secondary,labelColor:v.text,trackBarColor:"#F2F2F2",trackHighlightColor:"#FBE8F3",cellSize:40,cellGap:4},CFM_MATRIX:{rowLabelWidth:180,cellSelectedColor:v.accent,headerStyle:"bold",bipolarColumnWidthPercent:25,carouselDotColor:"#2563EB",cellPadding:8},CSAT_MATRIX:{rowLabelWidth:180,cellSelectedColor:v.accent,headerStyle:"bold",bipolarColumnWidthPercent:25,carouselDotColor:v.primary,cellPadding:8,accentColor:v.accent,emojiSize:24,unselectedOpacity:.5,selectedRingColor:v.accent,cellSize:40,tooltipBg:"#1F2937",graphicsTrackColor:"#E5E7EB",graphicsThumbColor:v.accent},RATING_MATRIX:{starColor:"#F59E0B",badgeColor:v.primary,rowLabelWidth:180,unselectedStarOpacity:.5,graphicsTrackColor:"#E5E7EB",graphicsThumbColor:v.primary},SLIDER_MATRIX:{trackColor:v.accent,thumbColor:v.primary,tickColor:"#9CA3AF",rowLabelWidth:180,rowBandColor:"#F3F4F6",tickBadgeSize:28,hintMinText:"Label 1",hintMaxText:"Label 2",hintLabelColor:"#6B7280",hintLabelBgColor:"transparent"},FILE_UPLOAD:{dropzoneStyle:"dashed",accentColor:v.accent,dropzonePadding:24},TEXT_AND_MEDIA:{mediaMaxWidth:100,mediaRadius:8,captionColor:"#6B7280",captionSize:14},HEATMAP:{pinColor:v.accent,pinSize:12,pinBorderColor:"#FFFFFF",overlayOpacity:.3},RANK_ORDER:{drag:{itemBg:"#F9FAFB",dragHandleColor:"#9CA3AF",rankBadgeColor:v.primary,itemPadding:12,itemGap:8},dropdown:{itemBg:"#F9FAFB",selectBorderColor:"#E5E7EB",rankBadgeColor:v.primary,itemPadding:12,itemGap:8}}}});import*as je from"fs";import*as Te from"path";function ho(e){let o={},t=/--cfm-[\w-]+\s*:\s*([^;]+);/g,n;for(;(n=t.exec(e))!==null;){let r=n[0].split(":")[0].trim(),i=n[1].trim();o[r]=i}return o}function A(e){if(!e)return;let o=parseFloat(e.replace(/px$/,""));return Number.isFinite(o)?o:void 0}function yo(e){if(!e)return;let o=parseFloat(e.replace(/%$/,""));return Number.isFinite(o)?o:void 0}function Ce(e){if(!e)return;let o=parseFloat(e);return Number.isFinite(o)?o:void 0}function wo(e){let o={global:{},questionTypes:{}},t=o.global,n={},r={},i={},s={},c={},d={},g={},b=o.questionTypes;if(e["--cfm-primary"]&&(n.primary=e["--cfm-primary"]),e["--cfm-secondary"]&&(n.secondary=e["--cfm-secondary"]),e["--cfm-accent"]&&(n.accent=e["--cfm-accent"]),e["--cfm-background"]&&(n.background=e["--cfm-background"]),e["--cfm-text"]&&(n.text=e["--cfm-text"]),e["--cfm-button-text"]&&(n.buttonText=e["--cfm-button-text"]),e["--cfm-max-width"]&&po[e["--cfm-max-width"]]&&(c.width=po[e["--cfm-max-width"]]),e["--cfm-border-radius"]&&go[e["--cfm-border-radius"]]&&(c.borderStyle=go[e["--cfm-border-radius"]]),e["--cfm-font-family"]&&(d.fontFamily=e["--cfm-font-family"],mo[e["--cfm-font-family"]]&&(c.fontStyle=mo[e["--cfm-font-family"]])),e["--cfm-heading-weight"]&&(d.headingWeight=Ce(e["--cfm-heading-weight"])),e["--cfm-motion-duration"]){let B=A(e["--cfm-motion-duration"]);B!==void 0&&(g.durationMs=B,g.enabled=B>0)}e["--cfm-header-height"]&&(r.height=A(e["--cfm-header-height"])),e["--cfm-header-logo-width"]&&(r.logoBoxWidth=A(e["--cfm-header-logo-width"])),e["--cfm-header-logo-height"]&&(r.logoBoxHeight=A(e["--cfm-header-logo-height"])),e["--cfm-header-logo-padding"]&&(r.logoPadding=A(e["--cfm-header-logo-padding"])),e["--cfm-header-bg"]&&(r.backgroundColor=e["--cfm-header-bg"]),e["--cfm-header-company-color"]&&(r.companyNameColor=e["--cfm-header-company-color"]),e["--cfm-header-company-size"]&&(r.companyNameFontSize=A(e["--cfm-header-company-size"])),e["--cfm-header-company-weight"]&&(r.companyNameFontWeight=Ce(e["--cfm-header-company-weight"])),e["--cfm-header-border"]&&(r.borderBottomColor=e["--cfm-header-border"]),e["--cfm-header-padding-x"]&&(r.contentPaddingX=A(e["--cfm-header-padding-x"])),e["--cfm-footer-bg"]&&(i.backgroundColor=e["--cfm-footer-bg"]),e["--cfm-footer-text"]&&(i.textColor=e["--cfm-footer-text"]),e["--cfm-footer-link"]&&(i.linkColor=e["--cfm-footer-link"]),e["--cfm-footer-link-hover"]&&(i.linkHoverColor=e["--cfm-footer-link-hover"]),e["--cfm-footer-logo-width"]&&(i.logoWidth=A(e["--cfm-footer-logo-width"])),e["--cfm-footer-logo-height"]&&(i.logoHeight=A(e["--cfm-footer-logo-height"])),e["--cfm-footer-padding-y"]&&(i.paddingY=A(e["--cfm-footer-padding-y"])),e["--cfm-footer-padding-x"]&&(i.paddingX=A(e["--cfm-footer-padding-x"])),e["--cfm-background"]&&(s.pageBackground=e["--cfm-background"]),e["--cfm-card-bg"]&&(s.cardBackground=e["--cfm-card-bg"]),e["--cfm-card-border-color"]&&(s.cardBorderColor=e["--cfm-card-border-color"]),e["--cfm-card-padding"]&&(s.cardPadding=A(e["--cfm-card-padding"])),e["--cfm-card-shadow"]&&(s.cardShadowEnabled=e["--cfm-card-shadow"]!=="none"),e["--cfm-selected-bg"]&&(s.selectedBackground=e["--cfm-selected-bg"]),e["--cfm-zebra-row"]&&(s.zebraRowColor=e["--cfm-zebra-row"]),e["--cfm-row-band"]&&(s.rowBandColor=e["--cfm-row-band"]),e["--cfm-validation-border"]&&(s.validationBorder=e["--cfm-validation-border"]),e["--cfm-validation-bg"]&&(s.validationBackground=e["--cfm-validation-bg"]),e["--cfm-tooltip-bg"]&&(s.tooltipBackground=e["--cfm-tooltip-bg"]),e["--cfm-progress-height"]&&(s.progressTrackHeight=A(e["--cfm-progress-height"])),e["--cfm-progress-track"]&&(s.progressTrackColor=e["--cfm-progress-track"]),e["--cfm-progress-fill"]&&(s.progressFillColor=e["--cfm-progress-fill"]),e["--cfm-sticky-pt"]&&(s.stickyChromePaddingTop=A(e["--cfm-sticky-pt"])),e["--cfm-sticky-pb"]&&(s.stickyChromePaddingBottom=A(e["--cfm-sticky-pb"]));let S={};e["--cfm-mcq-selected-accent"]&&(S.selectedAccent=e["--cfm-mcq-selected-accent"]),e["--cfm-mcq-border-radius"]&&(S.borderRadius=A(e["--cfm-mcq-border-radius"])),e["--cfm-mcq-option-gap"]&&(S.optionGap=A(e["--cfm-mcq-option-gap"])),e["--cfm-mcq-card-padding"]&&(S.cardPadding=A(e["--cfm-mcq-card-padding"])),e["--cfm-mcq-selected-bg"]&&(S.selectedBackground=e["--cfm-mcq-selected-bg"]),e["--cfm-mcq-hover-border"]&&(S.hoverBorderColor=e["--cfm-mcq-hover-border"]),Object.keys(S).length&&(b.MCQ=S);let x={};e["--cfm-input-radius"]&&(x.inputRadius=A(e["--cfm-input-radius"])),e["--cfm-input-focus-ring"]&&(x.focusRing=e["--cfm-input-focus-ring"]),e["--cfm-input-border"]&&(x.borderColor=e["--cfm-input-border"]),e["--cfm-input-padding"]&&(x.inputPadding=A(e["--cfm-input-padding"])),e["--cfm-input-height"]&&(x.inputHeight=A(e["--cfm-input-height"])),e["--cfm-input-placeholder"]&&(x.placeholderColor=e["--cfm-input-placeholder"]),Object.keys(x).length&&(b.TEXTFIELD=x);let k={};e["--cfm-nps-selected-fill"]&&(k.selectedFill=e["--cfm-nps-selected-fill"]),e["--cfm-nps-label-color"]&&(k.labelColor=e["--cfm-nps-label-color"]),e["--cfm-nps-track-bar"]&&(k.trackBarColor=e["--cfm-nps-track-bar"]),e["--cfm-nps-track-highlight"]&&(k.trackHighlightColor=e["--cfm-nps-track-highlight"]),e["--cfm-nps-cell-size"]&&(k.cellSize=A(e["--cfm-nps-cell-size"])),e["--cfm-nps-cell-gap"]&&(k.cellGap=A(e["--cfm-nps-cell-gap"])),Object.keys(k).length&&(b.NPS_SCALE=k);let E=A(e["--cfm-matrix-row-width"]),$={};E!==void 0&&($.rowLabelWidth=E),e["--cfm-matrix-selected"]&&($.cellSelectedColor=e["--cfm-matrix-selected"]),e["--cfm-matrix-bipolar-width"]&&($.bipolarColumnWidthPercent=yo(e["--cfm-matrix-bipolar-width"])),e["--cfm-matrix-carousel-dot"]&&($.carouselDotColor=e["--cfm-matrix-carousel-dot"]),e["--cfm-matrix-cell-padding"]&&($.cellPadding=A(e["--cfm-matrix-cell-padding"])),Object.keys($).length&&(b.CFM_MATRIX=$);let f={...$};e["--cfm-csat-accent"]&&(f.accentColor=e["--cfm-csat-accent"]),e["--cfm-csat-emoji-size"]&&(f.emojiSize=A(e["--cfm-csat-emoji-size"])),e["--cfm-csat-unselected-opacity"]&&(f.unselectedOpacity=Ce(e["--cfm-csat-unselected-opacity"])),e["--cfm-csat-ring-color"]&&(f.selectedRingColor=e["--cfm-csat-ring-color"]),e["--cfm-csat-cell-size"]&&(f.cellSize=A(e["--cfm-csat-cell-size"])),e["--cfm-csat-tooltip-bg"]&&(f.tooltipBg=e["--cfm-csat-tooltip-bg"]),(Object.keys(f).length>Object.keys($).length||e["--cfm-csat-accent"])&&(b.CSAT_MATRIX=f);let y={};e["--cfm-star-color"]&&(y.starColor=e["--cfm-star-color"]),e["--cfm-badge-color"]&&(y.badgeColor=e["--cfm-badge-color"]),E!==void 0&&(y.rowLabelWidth=E),e["--cfm-star-unselected-opacity"]&&(y.unselectedStarOpacity=Ce(e["--cfm-star-unselected-opacity"])),Object.keys(y).length&&(b.RATING_MATRIX=y);let T={};e["--cfm-slider-track"]&&(T.trackColor=e["--cfm-slider-track"]),e["--cfm-slider-thumb"]&&(T.thumbColor=e["--cfm-slider-thumb"]),e["--cfm-slider-tick"]&&(T.tickColor=e["--cfm-slider-tick"]),E!==void 0&&(T.rowLabelWidth=E),e["--cfm-slider-row-band"]&&(T.rowBandColor=e["--cfm-slider-row-band"]),e["--cfm-slider-tick-size"]&&(T.tickBadgeSize=A(e["--cfm-slider-tick-size"])),Object.keys(T).length&&(b.SLIDER_MATRIX=T);let R={};e["--cfm-upload-accent"]&&(R.accentColor=e["--cfm-upload-accent"]),e["--cfm-upload-padding"]&&(R.dropzonePadding=A(e["--cfm-upload-padding"])),Object.keys(R).length&&(b.FILE_UPLOAD=R);let w={};e["--cfm-media-max-width"]&&(w.mediaMaxWidth=yo(e["--cfm-media-max-width"])),e["--cfm-media-radius"]&&(w.mediaRadius=A(e["--cfm-media-radius"])),e["--cfm-media-caption-color"]&&(w.captionColor=e["--cfm-media-caption-color"]),e["--cfm-media-caption-size"]&&(w.captionSize=A(e["--cfm-media-caption-size"])),Object.keys(w).length&&(b.TEXT_AND_MEDIA=w);let F={};e["--cfm-heatmap-pin"]&&(F.pinColor=e["--cfm-heatmap-pin"]),e["--cfm-heatmap-pin-size"]&&(F.pinSize=A(e["--cfm-heatmap-pin-size"])),e["--cfm-heatmap-pin-border"]&&(F.pinBorderColor=e["--cfm-heatmap-pin-border"]),e["--cfm-heatmap-overlay-opacity"]&&(F.overlayOpacity=Ce(e["--cfm-heatmap-overlay-opacity"])),Object.keys(F).length&&(b.HEATMAP=F);let C={};return e["--cfm-rank-item-bg"]&&(C.itemBg=e["--cfm-rank-item-bg"]),e["--cfm-rank-badge"]&&(C.rankBadgeColor=e["--cfm-rank-badge"]),e["--cfm-rank-handle"]&&(C.dragHandleColor=e["--cfm-rank-handle"]),e["--cfm-rank-item-padding"]&&(C.itemPadding=A(e["--cfm-rank-item-padding"])),e["--cfm-rank-item-gap"]&&(C.itemGap=A(e["--cfm-rank-item-gap"])),Object.keys(C).length&&(b.RANK_ORDER=C),Object.keys(n).length&&(t.colorScheme=n),Object.keys(r).length&&(t.header=r),Object.keys(i).length&&(t.footer=i),Object.keys(s).length&&(t.theme=s),Object.keys(c).length&&(t.layout=c),Object.keys(d).length&&(t.typography=d),Object.keys(g).length&&(t.motion=g),o}function fe(e){let o=[Te.join(e,"src","styles","survey-theme.css"),Te.join(e,"src","app","survey-theme.css"),Te.join(e,"src","styles","globals.css"),Te.join(e,"src","app","globals.css")];for(let t of o)if(je.existsSync(t)&&je.readFileSync(t,"utf8").includes("--cfm-"))return t;return null}var po,go,mo,De=z(()=>{"use strict";po={"36rem":"narrow","48rem":"standard","64rem":"wide"},go={"0px":"sharp","12px":"rounded","9999px":"pill"},mo={"system-ui, sans-serif":"system","Inter, sans-serif":"modern","Georgia, serif":"serif"}});import*as ve from"fs";import*as bo from"path";function yt(e){for(let o of mt){let t=bo.join(e,o);if(ve.existsSync(t))return t}return null}function ht(e){let o=e.trim();if(!o||o.startsWith("http")||o.startsWith("data:"))return null;let t=o.split("?")[0];return t.startsWith("/")?t.slice(1):t}function So(e){let o=yt(e);if(!o)return null;let t=ve.readFileSync(o,"utf8"),n=t.match(/data-cfm-logo[\s\S]*?src=["']([^"']+)["']/i)??t.match(/src=["']([^"']+)["'][\s\S]*?data-cfm-logo/i);if(n){let s=ht(n[1]);if(s)return{mode:"image",publicPath:s,fileName:s}}let r=t.match(/data-cfm-logo-text[^>]*>([^<]+)</i);if(r)return{mode:"text",label:r[1].trim()};let i=t.match(/data-cfm-company[^>]*>([^<]+)</i);return i&&!n?{mode:"text",label:i[1].trim()}:null}var mt,Co=z(()=>{"use strict";mt=["src/components/Header.tsx","components/Header.tsx","app/components/Header.tsx"]});var Ao={};Ie(Ao,{logSeedSource:()=>Ve,resolveInitialConfig:()=>pe,writeResolvedUiConfig:()=>Je});import*as G from"fs";import*as ee from"path";function He(e){return e.filter(o=>J.includes(o))}function To(e){try{let o=JSON.parse(G.readFileSync(e,"utf8"));return o.version!=="1.0"?null:(delete o.configuredAt,o)}catch{return null}}function St(e){let o={global:{}};if(!G.existsSync(e))return o;let t=G.readFileSync(e,"utf8"),n=new Set;for(let i of J)t.includes(i)&&n.add(i);n.size&&(o.surveyTypes=[...n]);let r=t.match(/\*\*Branding source:\*\*\s*(.+)/i);if(r){let i=r[1].trim(),s=i.match(/company[:\s]+([^,;]+)/i),c=i.match(/title[:\s]+([^,;]+)/i);if(s&&(o.global.companyName=s[1].trim()),c){let d=c[1].trim();o.global.surveyTitle=d,o.global.browserTabTitle=d}}return o}function $o(e,o){let t=ee.join(e,o);if(!G.existsSync(t))return null;let n=G.readFileSync(t);if(n.length>wt)return{fileName:o,dataUrl:""};let r=ee.extname(o).toLowerCase(),i=bt[r]??"application/octet-stream";return{fileName:o,dataUrl:`data:${i};base64,${n.toString("base64")}`}}function xo(e,o){if(!o)return null;if(o.url&&typeof o.url=="string")return{fileName:o.fileName??null,url:o.url};if(o.fileName){let t=$o(e,o.fileName);if(t)return{fileName:t.fileName,url:t.dataUrl||null}}return o.fileName===null&&o.url===null?{fileName:null,url:null}:null}function Ro(e,o){let t=e.global??{},n=o.global??{},r=e.questionTypes??{},i=o.questionTypes??{},s={...r};for(let[c,d]of Object.entries(i))s[c]={...s[c]??{},...d};return{...e,...o,surveyTypes:o.surveyTypes??e.surveyTypes,global:{...t,...n,header:{...t.header,...n.header},footer:{...t.footer,...n.footer},theme:{...t.theme,...n.theme},layout:{...t.layout,...n.layout},buttons:{...t.buttons,...n.buttons},logo:{...t.logo,...n.logo},colorScheme:{...t.colorScheme,...n.colorScheme},typography:{...t.typography,...n.typography},motion:{...t.motion,...n.motion}},questionTypes:s,placeholders:{...e.placeholders,...o.placeholders},customFields:{...e.customFields,...o.customFields},deploy:{...e.deploy,...o.deploy}}}function pe(e){let o=e.projectRoot??process.env.INIT_CWD??process.cwd(),t=ee.join(o,"survey-ui-config.json"),n=ee.join(o,"implementation_plan.md"),r=ee.join(o,"public"),i=He(e.surveyTypes),s={},c="defaults",d=fe(o);if(d){let C=G.readFileSync(d,"utf8"),B=ho(C);Object.keys(B).length>0&&(s=wo(B),c="survey-theme.css")}let g=St(n);s=Ro(s,g);let b=To(t);b&&(s=Ro(s,b),c="survey-ui-config.json");let S=ee.join(o,"survey-ui-config.final.json"),x=To(S),k=!!b?.configuredAt,E=!!x?.configuredAt;if(x&&E&&!k){let C=xo(r,x.global?.logo);C&&(s.global={...s.global??{},logo:{fileName:C.fileName,url:C.url}})}let $=xo(r,s.global?.logo),f=So(o),y=!!b?.configuredAt,T=$?.fileName!=null&&/^logo_\d+_/i.test($.fileName),R=f?.mode==="image"?f.fileName:null,w=!y&&T&&R!=null&&$?.fileName!==R;if($&&!w)s.global={...s.global??{},logo:{fileName:$.fileName,url:$.url}};else if(f?.mode==="image"){let C=$o(r,f.fileName);s.global={...s.global??{},logo:{fileName:f.fileName,url:C?.dataUrl||null}}}else f?.mode==="text"&&(s.global={...s.global??{},logo:{fileName:null,url:null},companyName:s.global?.companyName??f.label});return s.surveyTypes=He(s.surveyTypes??i),s.surveyTypes?.length||(s.surveyTypes=i),e.instanceId&&(s.instanceId=e.instanceId),{config:_e(s),source:c}}function Ve(e){console.log(e==="survey-ui-config.json"?`${ue.dim} Seeding wizard from survey-ui-config.json${ue.reset}`:e==="survey-theme.css"?`${ue.dim} Seeding wizard from survey-theme.css + defaults${ue.reset}`:`${ue.dim} Seeding wizard from SDK defaults${ue.reset}`)}function Je(e={}){let o=e.projectRoot??process.env.INIT_CWD??process.cwd(),t=e.surveyTypes??He(J),{config:n}=pe({projectRoot:o,surveyTypes:t,instanceId:e.instanceId}),r=ee.join(o,"survey-ui-config.json");return G.writeFileSync(r,JSON.stringify(n,null,2),"utf8"),r}var ue,wt,bt,xe=z(()=>{"use strict";q();Xe();De();Se();Co();ue=l,wt=512e3,bt={".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".svg":"image/svg+xml"}});function W(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function h(e,o){return typeof e=="number"&&Number.isFinite(e)?e:o}function a(e,o){return typeof e=="string"&&e.length?e:o}function _t(){return{"--cfm-header-brand-gap":"16px","--cfm-header-padding-y":"12px","--cfm-header-company-margin-top":"0","--cfm-header-company-margin-left":"0","--cfm-header-company-margin-right":"0","--cfm-header-logo-col":"1","--cfm-header-logo-justify":"start"}}function jt(){return{"--cfm-footer-inner-display":"grid","--cfm-footer-inner-direction":"row","--cfm-footer-logo-col":"1","--cfm-footer-logo-justify":"start","--cfm-footer-links-col":"3","--cfm-footer-links-justify":"end","--cfm-footer-logo-copyright-gap":"12px"}}function Me(e,o){o.numberLabelMode&&(e["--cfm-number-label-mode"]=a(o.numberLabelMode,"traffic")),o.monochromeNumberColor&&(e["--cfm-number-mono-color"]=a(o.monochromeNumberColor,"#9CA3AF"));let t=o.individualNumberColors;Array.isArray(t)&&t.forEach((n,r)=>{typeof n=="string"&&(e[`--cfm-number-color-${r}`]=n)})}function jo(e,o){o.hintLabelColor&&(e["--cfm-hint-label-color"]=a(o.hintLabelColor,"#6B7280")),o.hintLabelBgColor&&(e["--cfm-hint-label-bg"]=a(o.hintLabelBgColor,"transparent"))}function Be(e,o,t){(t==="matrix"||t==="csat")&&(o.columnLabelColor&&(e["--cfm-matrix-column-label-color"]=a(o.columnLabelColor,"#4B5563")),o.columnLabelBgColor&&(e["--cfm-matrix-column-label-bg"]=a(o.columnLabelBgColor,"transparent"))),t==="csat"&&(o.columnLabelColor&&(e["--cfm-csat-column-label-color"]=a(o.columnLabelColor,"#4B5563")),o.columnLabelBgColor&&(e["--cfm-csat-column-label-bg"]=a(o.columnLabelBgColor,"transparent"))),t==="rating"&&(o.columnLabelColor&&(e["--cfm-rating-column-label-color"]=a(o.columnLabelColor,"#4B5563")),o.columnLabelBgColor&&(e["--cfm-rating-column-label-bg"]=a(o.columnLabelBgColor,"transparent"))),t==="slider"&&(o.columnLabelColor&&(e["--cfm-slider-tick-label-color"]=a(o.columnLabelColor,"#4B5563")),o.columnLabelBgColor&&(e["--cfm-slider-tick-label-bg"]=a(o.columnLabelBgColor,"transparent")))}function Dt(e,o){let t=a(o.optionStyle??o.cardStyle,"outlined");e["--cfm-mcq-border-radius"]=`${h(o.borderRadius,8)}px`,e["--cfm-mcq-option-gap"]=`${h(o.optionGap,8)}px`,e["--cfm-mcq-card-padding"]=`${h(o.optionPadding??o.cardPadding,12)}px`,e["--cfm-mcq-hover-border"]=a(o.hoverBorderColor,"#00B5AD"),e["--cfm-mcq-option-style"]=t,o.filledOptionBg&&(e["--cfm-mcq-filled-bg"]=a(o.filledOptionBg,"#F9FAFB"))}function vt(e,o){e["--cfm-input-radius"]=`${h(o.inputRadius,8)}px`,e["--cfm-input-border"]=a(o.borderColor,"#E5E7EB"),e["--cfm-input-padding"]=`${h(o.inputPadding,12)}px`,e["--cfm-input-height"]=`${h(o.inputHeight,44)}px`,e["--cfm-input-placeholder"]=a(o.placeholderColor,"#9CA3AF")}function Lt(e,o){e["--cfm-nps-cell-size"]=`${h(o.cellSize,40)}px`,e["--cfm-nps-cell-gap"]=`${h(o.cellGap,4)}px`,e["--cfm-nps-button-style"]=a(o.buttonStyle,"standard"),e["--cfm-nps-selected-fill"]=a(o.selectedFill,"#E8F5FD"),e["--cfm-nps-track-bar"]=a(o.trackBarColor,"#F2F2F2"),e["--cfm-nps-track-highlight"]=a(o.trackHighlightColor,"#FBE8F3"),jo(e,o),Me(e,o)}function Mt(e,o){e["--cfm-matrix-row-width"]=`${h(o.rowLabelWidth,180)}px`,e["--cfm-matrix-bipolar-width"]=`${h(o.bipolarColumnWidthPercent,25)}%`,e["--cfm-matrix-cell-padding"]=`${h(o.cellPadding,8)}px`,o.carouselDotColor&&(e["--cfm-matrix-carousel-dot"]=a(o.carouselDotColor,"#2563EB")),Be(e,o,"matrix")}function Bt(e,o){e["--cfm-csat-emoji-size"]=`${h(o.emojiSize,24)}px`,e["--cfm-csat-unselected-opacity"]=String(h(o.unselectedOpacity,.5)),e["--cfm-star-unselected-opacity"]=String(h(o.unselectedStarOpacity??o.unselectedOpacity,.5)),e["--cfm-csat-cell-size"]=`${h(o.cellSize,40)}px`,e["--cfm-csat-tooltip-bg"]=a(o.tooltipBg,"#1F2937"),e["--cfm-csat-accent"]=a(o.accentColor,e["--cfm-accent"]??"#00B5AD"),e["--cfm-matrix-row-width"]=`${h(o.rowLabelWidth,180)}px`,e["--cfm-slider-track"]=a(o.graphicsTrackColor,"#E5E7EB"),e["--cfm-slider-thumb"]=a(o.graphicsThumbColor,e["--cfm-accent"]??"#00B5AD"),Be(e,o,"csat"),Me(e,o)}function Ot(e,o){e["--cfm-star-color"]=a(o.starColor,"#F59E0B"),e["--cfm-badge-color"]=a(o.badgeColor,e["--cfm-primary"]??"#1A1F36"),e["--cfm-csat-emoji-size"]=`${h(o.emojiSize,24)}px`,e["--cfm-star-unselected-opacity"]=String(h(o.unselectedStarOpacity,.5)),e["--cfm-csat-unselected-opacity"]=String(h(o.unselectedStarOpacity,.5)),e["--cfm-matrix-row-width"]=`${h(o.rowLabelWidth,180)}px`,e["--cfm-slider-track"]=a(o.graphicsTrackColor,"#E5E7EB"),e["--cfm-slider-thumb"]=a(o.graphicsThumbColor,e["--cfm-primary"]??"#1A1F36"),Be(e,o,"rating"),Me(e,o)}function Ut(e,o){e["--cfm-slider-track"]=a(o.trackColor,e["--cfm-accent"]??"#00B5AD"),e["--cfm-slider-thumb"]=a(o.thumbColor,e["--cfm-primary"]??"#1A1F36"),e["--cfm-slider-tick"]=a(o.tickColor,"#9CA3AF"),e["--cfm-matrix-row-width"]=`${h(o.rowLabelWidth,180)}px`,e["--cfm-slider-row-band"]=a(o.rowBandColor,e["--cfm-row-band"]??"#F3F4F6"),e["--cfm-slider-tick-size"]=`${h(o.tickBadgeSize,28)}px`,Be(e,o,"slider"),jo(e,o),Me(e,o)}function zt(e,o){e["--cfm-upload-border-color"]=a(o.borderColor??o.accentColor,"#D1D5DB"),e["--cfm-upload-padding"]=`${h(o.dropzonePadding,24)}px`,e["--cfm-upload-fill"]=a(o.dropzoneFillColor,"#F9FAFB"),e["--cfm-upload-border-style"]=a(o.dropzoneStyle,"dashed")}function qt(e,o){e["--cfm-media-max-width"]=`${h(o.mediaMaxWidth,100)}%`,e["--cfm-media-radius"]=`${h(o.mediaRadius,8)}px`,e["--cfm-media-caption-color"]=a(o.captionColor,"#6B7280"),e["--cfm-media-caption-size"]=`${h(o.captionSize,14)}px`}function Wt(e,o){e["--cfm-heatmap-pin"]=a(o.pinColor,e["--cfm-accent"]??"#00B5AD"),e["--cfm-heatmap-pin-size"]=`${h(o.pinSize,12)}px`,e["--cfm-heatmap-pin-border"]=a(o.pinBorderColor,"#FFFFFF"),e["--cfm-heatmap-overlay-opacity"]=String(h(o.overlayOpacity,0))}function Xt(e,o){let t=W(o.drag)??o,n=W(o.dropdown)??t;e["--cfm-rank-item-bg"]=a(t.itemBg,"#F9FAFB"),e["--cfm-rank-badge-bg"]=a(t.rankBadgeColor,e["--cfm-primary"]??"#1A1F36"),e["--cfm-rank-badge-text"]="#ffffff",e["--cfm-rank-badge"]=a(t.rankBadgeColor,e["--cfm-primary"]??"#1A1F36"),e["--cfm-rank-item-padding"]=`${h(t.itemPadding,12)}px`,e["--cfm-rank-item-gap"]=`${h(t.itemGap,8)}px`,e["--cfm-rank-handle"]=a(t.dragHandleColor,"#9CA3AF"),e["--cfm-rank-select-border"]=a(n.selectBorderColor,"#E5E7EB")}function Oe(e){let o=W(e.global)??{},t=W(o.colorScheme)??{},n=W(o.header)??{},r=W(o.footer)??{},i=W(o.theme)??{},s=W(o.layout)??{},c=W(o.typography)??{},d=W(o.motion)??{},g=e.questionTypes??{},b=a(s.fontStyle,"modern"),S=_o[b]??a(c.fontFamily,_o.modern),x=a(s.width,"standard"),k=a(s.borderStyle,"rounded"),E=a(i.cellSelectedColor,a(t.accent,"#00B5AD")),$=a(i.focusRingColor,a(t.accent,"#00B5AD")),f=a(i.selectedBackground,a(t.secondary,"#E8F5FD")),y={"--cfm-primary":a(t.primary,"#1A1F36"),"--cfm-secondary":a(t.secondary,"#E8F5FD"),"--cfm-accent":a(t.accent,"#00B5AD"),"--cfm-background":a(i.pageBackground??t.background,"#FFFFFF"),"--cfm-text":a(t.text,"#1A1F36"),"--cfm-button-text":a(t.buttonText,"#FFFFFF"),"--cfm-max-width":Io[x]??Io.standard,"--cfm-border-radius":No[k]??No.rounded,"--cfm-font-family":S,"--cfm-heading-weight":String(h(c.headingWeight,700)),"--cfm-motion-duration":`${h(d.durationMs,200)}ms`,"--cfm-header-height":`${h(n.height,120)}px`,"--cfm-header-logo-width":`${h(n.logoBoxWidth,120)}px`,"--cfm-header-logo-height":`${h(n.logoBoxHeight,120)}px`,"--cfm-header-logo-padding":`${h(n.logoPadding,10)}px`,"--cfm-header-show-company":n.showCompanyName===!1?"0":"1","--cfm-header-bg":a(n.backgroundColor,"#FFFFFF"),"--cfm-header-company-color":a(n.companyNameColor,a(t.text,"#1A1F36")),"--cfm-header-company-size":`${h(n.companyNameFontSize,18)}px`,"--cfm-header-company-weight":String(h(n.companyNameFontWeight,600)),"--cfm-header-border":a(n.borderBottomColor,"#E5E7EB"),"--cfm-header-padding-x":`${h(n.contentPaddingX,40)}px`,"--cfm-header-shadow":n.shadowEnabled===!1?"none":"0 2px 8px rgba(0,0,0,0.06)",..._t(),"--cfm-footer-bg":a(r.backgroundColor,"#262626"),"--cfm-footer-text":a(r.textColor,"#9CA3AF"),"--cfm-footer-link":a(r.linkColor,"#9CA3AF"),"--cfm-footer-link-hover":a(r.linkHoverColor,"#FFFFFF"),"--cfm-footer-logo-width":`${h(r.logoWidth,120)}px`,"--cfm-footer-logo-height":`${h(r.logoHeight,32)}px`,"--cfm-footer-padding-y":`${h(r.paddingY,24)}px`,"--cfm-footer-padding-x":`${h(r.paddingX,40)}px`,...jt(),"--cfm-card-bg":a(i.cardBackground,"#FFFFFF"),"--cfm-card-border-color":a(i.cardBorderColor,"#E5E7EB"),"--cfm-card-padding":`${h(i.cardPadding,24)}px`,"--cfm-card-gap":"32px","--cfm-card-shadow":i.cardShadowEnabled===!1?"none":`0 ${h(i.cardShadowOffsetY,1)}px ${h(i.cardShadowBlur,3)}px ${a(i.cardShadowColor,"rgba(0,0,0,0.1)")}`,"--cfm-selected-bg":f,"--cfm-mcq-selected-accent":$,"--cfm-mcq-selected-bg":f,"--cfm-matrix-selected":E,"--cfm-csat-ring-color":E,"--cfm-input-focus-ring":$,"--cfm-zebra-row":a(i.zebraRowColor,"rgba(249,250,251,0.8)"),"--cfm-row-band":a(i.rowBandColor,"#F3F4F6"),"--cfm-validation-border":a(i.validationBorder,"#333333"),"--cfm-validation-bg":a(i.validationBackground,"#D9D9D9"),"--cfm-tooltip-bg":a(i.tooltipBackground,"#1F2937"),"--cfm-progress-height":`${h(i.progressTrackHeight,12)}px`,"--cfm-progress-track":a(i.progressTrackColor,"#E5E7EB"),"--cfm-progress-fill":a(i.progressFillColor,a(t.primary,"#1A1F36")),"--cfm-sticky-pt":`${h(i.stickyChromePaddingTop,16)}px`,"--cfm-sticky-pb":`${h(i.stickyChromePaddingBottom,20)}px`,"--cfm-language-bg":a(i.languageSelectorBackground,"#FFFFFF"),"--cfm-language-text":a(i.languageSelectorTextColor,"#2563EB"),"--cfm-language-border":a(i.languageSelectorBorderColor,"#2563EB")},T=[["MCQ",Dt],["TEXTFIELD",vt],["NPS_SCALE",Lt],["CFM_MATRIX",Mt],["CSAT_MATRIX",Bt],["RATING_MATRIX",Ot],["SLIDER_MATRIX",Ut],["FILE_UPLOAD",zt],["TEXT_AND_MEDIA",qt],["HEATMAP",Wt],["RANK_ORDER",Xt]];for(let[R,w]of T){let F=W(g[R]);F&&w(y,F)}return y}function Ze(e){let o=e.questionTypes??{},t=W(o.MCQ),n=W(o.NPS_SCALE),r=W(o.FILE_UPLOAD),i={};return i["data-cfm-mcq-style"]=a(t?.optionStyle??t?.cardStyle,"outlined"),n?.buttonStyle&&(i["data-cfm-nps-button-style"]=a(n.buttonStyle,"standard")),r?.dropzoneStyle&&(i["data-cfm-dropzone-style"]=a(r.dropzoneStyle,"dashed")),i}var Io,No,_o,eo=z(()=>{"use strict";Io={narrow:"36rem",standard:"48rem",wide:"64rem"},No={sharp:"0px",rounded:"12px",pill:"9999px"},_o={system:'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',inter:"Inter, system-ui, sans-serif",modern:"Inter, sans-serif",roboto:"Roboto, system-ui, sans-serif",openSans:'"Open Sans", system-ui, sans-serif',lato:"Lato, system-ui, sans-serif",poppins:"Poppins, system-ui, sans-serif",montserrat:"Montserrat, system-ui, sans-serif",nunito:"Nunito, system-ui, sans-serif",raleway:"Raleway, system-ui, sans-serif",sourceSans:'"Source Sans 3", system-ui, sans-serif',georgia:'Georgia, "Times New Roman", serif',serif:"Georgia, serif",merriweather:"Merriweather, Georgia, serif",playfair:'"Playfair Display", Georgia, serif'}});import*as oe from"fs";import*as se from"path";function Ht(e){return`:root {
|
|
2
|
+
var it=Object.defineProperty;var Pe=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(o,t)=>(typeof require<"u"?require:o)[t]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var z=(e,o)=>()=>(e&&(o=e(e=0)),o);var Ie=(e,o)=>{for(var t in o)it(e,t,{get:o[t],enumerable:!0})};var l,q=z(()=>{"use strict";l={reset:"\x1B[0m",bold:"\x1B[1m",green:"\x1B[32m",red:"\x1B[31m",cyan:"\x1B[36m",yellow:"\x1B[33m",dim:"\x1B[2m"}});var J,Se=z(()=>{"use strict";J=["MCQ","TEXTFIELD","NPS_SCALE","CFM_MATRIX","CSAT_MATRIX","RATING_MATRIX","SLIDER_MATRIX","FILE_UPLOAD","TEXT_AND_MEDIA","HEATMAP","RANK_ORDER"]});function pt(e){let o={};for(let t of e)uo[t]&&(o[t]={...uo[t]});return o}function gt(e=[],o){return{version:"1.0",instanceId:o,surveyTypes:e,global:{surveyTitle:"Customer Feedback Survey",companyName:"Sprinklr",browserTabTitle:"Customer Feedback Survey",thankYouMessage:"Thank you for your valuable feedback!",logo:{fileName:null,url:null},header:{height:120,logoBoxWidth:120,logoBoxHeight:120,logoPadding:10,logoPlacement:"left",showCompanyName:!0,companyNamePlacement:"left",companyNameFontSize:18,companyNameFontWeight:600,companyNameColor:"#1A1F36",backgroundColor:"#FFFFFF",shadowEnabled:!0,borderBottomColor:"#E5E7EB",contentPaddingX:40},footer:{backgroundColor:"#262626",textColor:"#9CA3AF",linkColor:"#9CA3AF",linkHoverColor:"#FFFFFF",showLogo:!0,logoWidth:120,logoHeight:32,logoPlacement:"left",copyrightText:"\xA9 Company Name",layout:"row",paddingY:21,paddingX:40,links:[]},theme:{pageBackground:"#FFFFFF",cardBackground:"#FFFFFF",cardBorderColor:"#E5E7EB",cardPadding:24,cardShadowEnabled:!0,selectedBackground:"#E8F5FD",zebraRowColor:"rgba(249,250,251,0.8)",rowBandColor:"#F3F4F6",validationBorder:"#333333",validationBackground:"#D9D9D9",tooltipBackground:"#1F2937",progressTrackHeight:12,progressTrackColor:"#E5E7EB",progressFillColor:"#1A1F36",stickyChromePaddingTop:16,stickyChromePaddingBottom:20,languageSelectorBackground:"#FFFFFF",languageSelectorTextColor:"#2563EB",languageSelectorBorderColor:"#2563EB"},layout:{showHeader:!0,showFooter:!0,showProgressBar:!0,showLanguageSwitcher:!1,showNextButton:!0,showBackButton:!0,showQuestionNumbers:!0,showRequiredAsterisk:!0,width:"standard",borderStyle:"rounded",fontStyle:"modern"},buttons:{next:"Next",back:"Back",submit:"Submit"},colorScheme:{...v},colorSource:"auto",typography:{fontFamily:"Inter, sans-serif",headingWeight:700},motion:{enabled:!1,durationMs:200}},questionTypes:pt(e),placeholders:{firstName:"Alex",lastName:"Customer",email:"alex@example.com"},customFields:{},debug:{enabled:!1,sampleAnswers:{}},deploy:{target:"aws",autoDeploy:!1}}}function Z(e,o){return{...e,...o??{}}}function _e(e){let o=(e.surveyTypes??[]).filter(c=>J.includes(c)),t=[...new Set([...o,...J])],n=gt(t,e.instanceId),r=e.global??{},i=n.global,s={...n.questionTypes};if(e.questionTypes)for(let[c,d]of Object.entries(e.questionTypes))s[c]={...s[c]??{},...d};return{...n,...e,configuredAt:void 0,surveyTypes:o.length?o:n.surveyTypes,global:{...i,...r,header:Z(i.header,r.header),footer:Z(i.footer,r.footer),theme:Z(i.theme,r.theme),layout:Z(i.layout,r.layout),buttons:Z(i.buttons,r.buttons),logo:Z(i.logo,r.logo),colorScheme:Z(i.colorScheme,r.colorScheme),typography:Z(i.typography,r.typography),motion:Z(i.motion,r.motion)},questionTypes:s,placeholders:{...n.placeholders,...e.placeholders??{}},customFields:{...n.customFields,...e.customFields??{}},debug:{enabled:e.debug?.enabled??n.debug?.enabled??!1,sampleAnswers:e.debug?.sampleAnswers??n.debug?.sampleAnswers},deploy:{...n.deploy,...e.deploy??{}}}}var v,uo,Xe=z(()=>{"use strict";Se();v={primary:"#1A1F36",secondary:"#E8F5FD",accent:"#00B5AD",background:"#FFFFFF",text:"#1A1F36",buttonText:"#FFFFFF"},uo={MCQ:{cardStyle:"outlined",selectedAccent:v.accent,optionGap:8,borderRadius:8,cardPadding:12,selectedBackground:v.secondary,hoverBorderColor:v.accent},TEXTFIELD:{inputRadius:8,focusRing:v.accent,borderColor:"#E5E7EB",inputPadding:12,inputHeight:44,placeholderColor:"#9CA3AF"},NPS_SCALE:{buttonStyle:"standard",selectedFill:v.secondary,labelColor:v.text,trackBarColor:"#F2F2F2",trackHighlightColor:"#FBE8F3",cellSize:40,cellGap:4},CFM_MATRIX:{rowLabelWidth:180,cellSelectedColor:v.accent,headerStyle:"bold",bipolarColumnWidthPercent:25,carouselDotColor:"#2563EB",cellPadding:8},CSAT_MATRIX:{rowLabelWidth:180,cellSelectedColor:v.accent,headerStyle:"bold",bipolarColumnWidthPercent:25,carouselDotColor:v.primary,cellPadding:8,accentColor:v.accent,emojiSize:24,unselectedOpacity:.5,selectedRingColor:v.accent,cellSize:40,tooltipBg:"#1F2937",graphicsTrackColor:"#E5E7EB",graphicsThumbColor:v.accent},RATING_MATRIX:{starColor:"#F59E0B",badgeColor:v.primary,rowLabelWidth:180,unselectedStarOpacity:.5,graphicsTrackColor:"#E5E7EB",graphicsThumbColor:v.primary},SLIDER_MATRIX:{trackColor:v.accent,thumbColor:v.primary,tickColor:"#9CA3AF",rowLabelWidth:180,rowBandColor:"#F3F4F6",tickBadgeSize:28,hintMinText:"Label 1",hintMaxText:"Label 2",hintLabelColor:"#6B7280",hintLabelBgColor:"transparent"},FILE_UPLOAD:{dropzoneStyle:"dashed",accentColor:v.accent,dropzonePadding:24},TEXT_AND_MEDIA:{mediaMaxWidth:100,mediaRadius:8,captionColor:"#6B7280",captionSize:14},HEATMAP:{pinColor:v.accent,pinSize:12,pinBorderColor:"#FFFFFF",overlayOpacity:.3},RANK_ORDER:{drag:{itemBg:"#F9FAFB",dragHandleColor:"#9CA3AF",rankBadgeColor:v.primary,itemPadding:12,itemGap:8},dropdown:{itemBg:"#F9FAFB",selectBorderColor:"#E5E7EB",rankBadgeColor:v.primary,itemPadding:12,itemGap:8}}}});import*as je from"fs";import*as Te from"path";function ho(e){let o={},t=/--cfm-[\w-]+\s*:\s*([^;]+);/g,n;for(;(n=t.exec(e))!==null;){let r=n[0].split(":")[0].trim(),i=n[1].trim();o[r]=i}return o}function A(e){if(!e)return;let o=parseFloat(e.replace(/px$/,""));return Number.isFinite(o)?o:void 0}function yo(e){if(!e)return;let o=parseFloat(e.replace(/%$/,""));return Number.isFinite(o)?o:void 0}function Ce(e){if(!e)return;let o=parseFloat(e);return Number.isFinite(o)?o:void 0}function wo(e){let o={global:{},questionTypes:{}},t=o.global,n={},r={},i={},s={},c={},d={},g={},b=o.questionTypes;if(e["--cfm-primary"]&&(n.primary=e["--cfm-primary"]),e["--cfm-secondary"]&&(n.secondary=e["--cfm-secondary"]),e["--cfm-accent"]&&(n.accent=e["--cfm-accent"]),e["--cfm-background"]&&(n.background=e["--cfm-background"]),e["--cfm-text"]&&(n.text=e["--cfm-text"]),e["--cfm-button-text"]&&(n.buttonText=e["--cfm-button-text"]),e["--cfm-max-width"]&&po[e["--cfm-max-width"]]&&(c.width=po[e["--cfm-max-width"]]),e["--cfm-border-radius"]&&go[e["--cfm-border-radius"]]&&(c.borderStyle=go[e["--cfm-border-radius"]]),e["--cfm-font-family"]&&(d.fontFamily=e["--cfm-font-family"],mo[e["--cfm-font-family"]]&&(c.fontStyle=mo[e["--cfm-font-family"]])),e["--cfm-heading-weight"]&&(d.headingWeight=Ce(e["--cfm-heading-weight"])),e["--cfm-motion-duration"]){let B=A(e["--cfm-motion-duration"]);B!==void 0&&(g.durationMs=B,g.enabled=B>0)}e["--cfm-header-height"]&&(r.height=A(e["--cfm-header-height"])),e["--cfm-header-logo-width"]&&(r.logoBoxWidth=A(e["--cfm-header-logo-width"])),e["--cfm-header-logo-height"]&&(r.logoBoxHeight=A(e["--cfm-header-logo-height"])),e["--cfm-header-logo-padding"]&&(r.logoPadding=A(e["--cfm-header-logo-padding"])),e["--cfm-header-bg"]&&(r.backgroundColor=e["--cfm-header-bg"]),e["--cfm-header-company-color"]&&(r.companyNameColor=e["--cfm-header-company-color"]),e["--cfm-header-company-size"]&&(r.companyNameFontSize=A(e["--cfm-header-company-size"])),e["--cfm-header-company-weight"]&&(r.companyNameFontWeight=Ce(e["--cfm-header-company-weight"])),e["--cfm-header-border"]&&(r.borderBottomColor=e["--cfm-header-border"]),e["--cfm-header-padding-x"]&&(r.contentPaddingX=A(e["--cfm-header-padding-x"])),e["--cfm-footer-bg"]&&(i.backgroundColor=e["--cfm-footer-bg"]),e["--cfm-footer-text"]&&(i.textColor=e["--cfm-footer-text"]),e["--cfm-footer-link"]&&(i.linkColor=e["--cfm-footer-link"]),e["--cfm-footer-link-hover"]&&(i.linkHoverColor=e["--cfm-footer-link-hover"]),e["--cfm-footer-logo-width"]&&(i.logoWidth=A(e["--cfm-footer-logo-width"])),e["--cfm-footer-logo-height"]&&(i.logoHeight=A(e["--cfm-footer-logo-height"])),e["--cfm-footer-padding-y"]&&(i.paddingY=A(e["--cfm-footer-padding-y"])),e["--cfm-footer-padding-x"]&&(i.paddingX=A(e["--cfm-footer-padding-x"])),e["--cfm-background"]&&(s.pageBackground=e["--cfm-background"]),e["--cfm-card-bg"]&&(s.cardBackground=e["--cfm-card-bg"]),e["--cfm-card-border-color"]&&(s.cardBorderColor=e["--cfm-card-border-color"]),e["--cfm-card-padding"]&&(s.cardPadding=A(e["--cfm-card-padding"])),e["--cfm-card-shadow"]&&(s.cardShadowEnabled=e["--cfm-card-shadow"]!=="none"),e["--cfm-selected-bg"]&&(s.selectedBackground=e["--cfm-selected-bg"]),e["--cfm-zebra-row"]&&(s.zebraRowColor=e["--cfm-zebra-row"]),e["--cfm-row-band"]&&(s.rowBandColor=e["--cfm-row-band"]),e["--cfm-validation-border"]&&(s.validationBorder=e["--cfm-validation-border"]),e["--cfm-validation-bg"]&&(s.validationBackground=e["--cfm-validation-bg"]),e["--cfm-tooltip-bg"]&&(s.tooltipBackground=e["--cfm-tooltip-bg"]),e["--cfm-progress-height"]&&(s.progressTrackHeight=A(e["--cfm-progress-height"])),e["--cfm-progress-track"]&&(s.progressTrackColor=e["--cfm-progress-track"]),e["--cfm-progress-fill"]&&(s.progressFillColor=e["--cfm-progress-fill"]),e["--cfm-sticky-pt"]&&(s.stickyChromePaddingTop=A(e["--cfm-sticky-pt"])),e["--cfm-sticky-pb"]&&(s.stickyChromePaddingBottom=A(e["--cfm-sticky-pb"]));let S={};e["--cfm-mcq-selected-accent"]&&(S.selectedAccent=e["--cfm-mcq-selected-accent"]),e["--cfm-mcq-border-radius"]&&(S.borderRadius=A(e["--cfm-mcq-border-radius"])),e["--cfm-mcq-option-gap"]&&(S.optionGap=A(e["--cfm-mcq-option-gap"])),e["--cfm-mcq-card-padding"]&&(S.cardPadding=A(e["--cfm-mcq-card-padding"])),e["--cfm-mcq-selected-bg"]&&(S.selectedBackground=e["--cfm-mcq-selected-bg"]),e["--cfm-mcq-hover-border"]&&(S.hoverBorderColor=e["--cfm-mcq-hover-border"]),Object.keys(S).length&&(b.MCQ=S);let x={};e["--cfm-input-radius"]&&(x.inputRadius=A(e["--cfm-input-radius"])),e["--cfm-input-focus-ring"]&&(x.focusRing=e["--cfm-input-focus-ring"]),e["--cfm-input-border"]&&(x.borderColor=e["--cfm-input-border"]),e["--cfm-input-padding"]&&(x.inputPadding=A(e["--cfm-input-padding"])),e["--cfm-input-height"]&&(x.inputHeight=A(e["--cfm-input-height"])),e["--cfm-input-placeholder"]&&(x.placeholderColor=e["--cfm-input-placeholder"]),Object.keys(x).length&&(b.TEXTFIELD=x);let k={};e["--cfm-nps-selected-fill"]&&(k.selectedFill=e["--cfm-nps-selected-fill"]),e["--cfm-nps-label-color"]&&(k.labelColor=e["--cfm-nps-label-color"]),e["--cfm-nps-track-bar"]&&(k.trackBarColor=e["--cfm-nps-track-bar"]),e["--cfm-nps-track-highlight"]&&(k.trackHighlightColor=e["--cfm-nps-track-highlight"]),e["--cfm-nps-cell-size"]&&(k.cellSize=A(e["--cfm-nps-cell-size"])),e["--cfm-nps-cell-gap"]&&(k.cellGap=A(e["--cfm-nps-cell-gap"])),Object.keys(k).length&&(b.NPS_SCALE=k);let E=A(e["--cfm-matrix-row-width"]),$={};E!==void 0&&($.rowLabelWidth=E),e["--cfm-matrix-selected"]&&($.cellSelectedColor=e["--cfm-matrix-selected"]),e["--cfm-matrix-bipolar-width"]&&($.bipolarColumnWidthPercent=yo(e["--cfm-matrix-bipolar-width"])),e["--cfm-matrix-carousel-dot"]&&($.carouselDotColor=e["--cfm-matrix-carousel-dot"]),e["--cfm-matrix-cell-padding"]&&($.cellPadding=A(e["--cfm-matrix-cell-padding"])),Object.keys($).length&&(b.CFM_MATRIX=$);let f={...$};e["--cfm-csat-accent"]&&(f.accentColor=e["--cfm-csat-accent"]),e["--cfm-csat-emoji-size"]&&(f.emojiSize=A(e["--cfm-csat-emoji-size"])),e["--cfm-csat-unselected-opacity"]&&(f.unselectedOpacity=Ce(e["--cfm-csat-unselected-opacity"])),e["--cfm-csat-ring-color"]&&(f.selectedRingColor=e["--cfm-csat-ring-color"]),e["--cfm-csat-cell-size"]&&(f.cellSize=A(e["--cfm-csat-cell-size"])),e["--cfm-csat-tooltip-bg"]&&(f.tooltipBg=e["--cfm-csat-tooltip-bg"]),(Object.keys(f).length>Object.keys($).length||e["--cfm-csat-accent"])&&(b.CSAT_MATRIX=f);let y={};e["--cfm-star-color"]&&(y.starColor=e["--cfm-star-color"]),e["--cfm-badge-color"]&&(y.badgeColor=e["--cfm-badge-color"]),E!==void 0&&(y.rowLabelWidth=E),e["--cfm-star-unselected-opacity"]&&(y.unselectedStarOpacity=Ce(e["--cfm-star-unselected-opacity"])),Object.keys(y).length&&(b.RATING_MATRIX=y);let T={};e["--cfm-slider-track"]&&(T.trackColor=e["--cfm-slider-track"]),e["--cfm-slider-thumb"]&&(T.thumbColor=e["--cfm-slider-thumb"]),e["--cfm-slider-tick"]&&(T.tickColor=e["--cfm-slider-tick"]),E!==void 0&&(T.rowLabelWidth=E),e["--cfm-slider-row-band"]&&(T.rowBandColor=e["--cfm-slider-row-band"]),e["--cfm-slider-tick-size"]&&(T.tickBadgeSize=A(e["--cfm-slider-tick-size"])),Object.keys(T).length&&(b.SLIDER_MATRIX=T);let R={};e["--cfm-upload-accent"]&&(R.accentColor=e["--cfm-upload-accent"]),e["--cfm-upload-padding"]&&(R.dropzonePadding=A(e["--cfm-upload-padding"])),Object.keys(R).length&&(b.FILE_UPLOAD=R);let w={};e["--cfm-media-max-width"]&&(w.mediaMaxWidth=yo(e["--cfm-media-max-width"])),e["--cfm-media-radius"]&&(w.mediaRadius=A(e["--cfm-media-radius"])),e["--cfm-media-caption-color"]&&(w.captionColor=e["--cfm-media-caption-color"]),e["--cfm-media-caption-size"]&&(w.captionSize=A(e["--cfm-media-caption-size"])),Object.keys(w).length&&(b.TEXT_AND_MEDIA=w);let F={};e["--cfm-heatmap-pin"]&&(F.pinColor=e["--cfm-heatmap-pin"]),e["--cfm-heatmap-pin-size"]&&(F.pinSize=A(e["--cfm-heatmap-pin-size"])),e["--cfm-heatmap-pin-border"]&&(F.pinBorderColor=e["--cfm-heatmap-pin-border"]),e["--cfm-heatmap-overlay-opacity"]&&(F.overlayOpacity=Ce(e["--cfm-heatmap-overlay-opacity"])),Object.keys(F).length&&(b.HEATMAP=F);let C={};return e["--cfm-rank-item-bg"]&&(C.itemBg=e["--cfm-rank-item-bg"]),e["--cfm-rank-badge"]&&(C.rankBadgeColor=e["--cfm-rank-badge"]),e["--cfm-rank-handle"]&&(C.dragHandleColor=e["--cfm-rank-handle"]),e["--cfm-rank-item-padding"]&&(C.itemPadding=A(e["--cfm-rank-item-padding"])),e["--cfm-rank-item-gap"]&&(C.itemGap=A(e["--cfm-rank-item-gap"])),Object.keys(C).length&&(b.RANK_ORDER=C),Object.keys(n).length&&(t.colorScheme=n),Object.keys(r).length&&(t.header=r),Object.keys(i).length&&(t.footer=i),Object.keys(s).length&&(t.theme=s),Object.keys(c).length&&(t.layout=c),Object.keys(d).length&&(t.typography=d),Object.keys(g).length&&(t.motion=g),o}function fe(e){let o=[Te.join(e,"src","styles","survey-theme.css"),Te.join(e,"src","app","survey-theme.css"),Te.join(e,"src","styles","globals.css"),Te.join(e,"src","app","globals.css")];for(let t of o)if(je.existsSync(t)&&je.readFileSync(t,"utf8").includes("--cfm-"))return t;return null}var po,go,mo,De=z(()=>{"use strict";po={"36rem":"narrow","48rem":"standard","64rem":"wide"},go={"0px":"sharp","12px":"rounded","9999px":"pill"},mo={"system-ui, sans-serif":"system","Inter, sans-serif":"modern","Georgia, serif":"serif"}});import*as ve from"fs";import*as bo from"path";function yt(e){for(let o of mt){let t=bo.join(e,o);if(ve.existsSync(t))return t}return null}function ht(e){let o=e.trim();if(!o||o.startsWith("http")||o.startsWith("data:"))return null;let t=o.split("?")[0];return t.startsWith("/")?t.slice(1):t}function So(e){let o=yt(e);if(!o)return null;let t=ve.readFileSync(o,"utf8"),n=t.match(/data-cfm-logo[\s\S]*?src=["']([^"']+)["']/i)??t.match(/src=["']([^"']+)["'][\s\S]*?data-cfm-logo/i);if(n){let s=ht(n[1]);if(s)return{mode:"image",publicPath:s,fileName:s}}let r=t.match(/data-cfm-logo-text[^>]*>([^<]+)</i);if(r)return{mode:"text",label:r[1].trim()};let i=t.match(/data-cfm-company[^>]*>([^<]+)</i);return i&&!n?{mode:"text",label:i[1].trim()}:null}var mt,Co=z(()=>{"use strict";mt=["src/components/Header.tsx","components/Header.tsx","app/components/Header.tsx"]});var Ao={};Ie(Ao,{logSeedSource:()=>Ve,resolveInitialConfig:()=>pe,writeResolvedUiConfig:()=>Je});import*as G from"fs";import*as ee from"path";function He(e){return e.filter(o=>J.includes(o))}function To(e){try{let o=JSON.parse(G.readFileSync(e,"utf8"));return o.version!=="1.0"?null:(delete o.configuredAt,o)}catch{return null}}function St(e){let o={global:{}};if(!G.existsSync(e))return o;let t=G.readFileSync(e,"utf8"),n=new Set;for(let i of J)t.includes(i)&&n.add(i);n.size&&(o.surveyTypes=[...n]);let r=t.match(/\*\*Branding source:\*\*\s*(.+)/i);if(r){let i=r[1].trim(),s=i.match(/company[:\s]+([^,;]+)/i),c=i.match(/title[:\s]+([^,;]+)/i);if(s&&(o.global.companyName=s[1].trim()),c){let d=c[1].trim();o.global.surveyTitle=d,o.global.browserTabTitle=d}}return o}function $o(e,o){let t=ee.join(e,o);if(!G.existsSync(t))return null;let n=G.readFileSync(t);if(n.length>wt)return{fileName:o,dataUrl:""};let r=ee.extname(o).toLowerCase(),i=bt[r]??"application/octet-stream";return{fileName:o,dataUrl:`data:${i};base64,${n.toString("base64")}`}}function xo(e,o){if(!o)return null;if(o.url&&typeof o.url=="string")return{fileName:o.fileName??null,url:o.url};if(o.fileName){let t=$o(e,o.fileName);if(t)return{fileName:t.fileName,url:t.dataUrl||null}}return o.fileName===null&&o.url===null?{fileName:null,url:null}:null}function Ro(e,o){let t=e.global??{},n=o.global??{},r=e.questionTypes??{},i=o.questionTypes??{},s={...r};for(let[c,d]of Object.entries(i))s[c]={...s[c]??{},...d};return{...e,...o,surveyTypes:o.surveyTypes??e.surveyTypes,global:{...t,...n,header:{...t.header,...n.header},footer:{...t.footer,...n.footer},theme:{...t.theme,...n.theme},layout:{...t.layout,...n.layout},buttons:{...t.buttons,...n.buttons},logo:{...t.logo,...n.logo},colorScheme:{...t.colorScheme,...n.colorScheme},typography:{...t.typography,...n.typography},motion:{...t.motion,...n.motion}},questionTypes:s,placeholders:{...e.placeholders,...o.placeholders},customFields:{...e.customFields,...o.customFields},deploy:{...e.deploy,...o.deploy}}}function pe(e){let o=e.projectRoot??process.env.INIT_CWD??process.cwd(),t=ee.join(o,"survey-ui-config.json"),n=ee.join(o,"implementation_plan.md"),r=ee.join(o,"public"),i=He(e.surveyTypes),s={},c="defaults",d=fe(o);if(d){let C=G.readFileSync(d,"utf8"),B=ho(C);Object.keys(B).length>0&&(s=wo(B),c="survey-theme.css")}let g=St(n);s=Ro(s,g);let b=To(t);b&&(s=Ro(s,b),c="survey-ui-config.json");let S=ee.join(o,"survey-ui-config.final.json"),x=To(S),k=!!b?.configuredAt,E=!!x?.configuredAt;if(x&&E&&!k){let C=xo(r,x.global?.logo);C&&(s.global={...s.global??{},logo:{fileName:C.fileName,url:C.url}})}let $=xo(r,s.global?.logo),f=So(o),y=!!b?.configuredAt,T=$?.fileName!=null&&/^logo_\d+_/i.test($.fileName),R=f?.mode==="image"?f.fileName:null,w=!y&&T&&R!=null&&$?.fileName!==R;if($&&!w)s.global={...s.global??{},logo:{fileName:$.fileName,url:$.url}};else if(f?.mode==="image"){let C=$o(r,f.fileName);s.global={...s.global??{},logo:{fileName:f.fileName,url:C?.dataUrl||null}}}else f?.mode==="text"&&(s.global={...s.global??{},logo:{fileName:null,url:null},companyName:s.global?.companyName??f.label});return s.surveyTypes=He(s.surveyTypes??i),s.surveyTypes?.length||(s.surveyTypes=i),e.instanceId&&(s.instanceId=e.instanceId),{config:_e(s),source:c}}function Ve(e){console.log(e==="survey-ui-config.json"?`${ue.dim} Seeding wizard from survey-ui-config.json${ue.reset}`:e==="survey-theme.css"?`${ue.dim} Seeding wizard from survey-theme.css + defaults${ue.reset}`:`${ue.dim} Seeding wizard from SDK defaults${ue.reset}`)}function Je(e={}){let o=e.projectRoot??process.env.INIT_CWD??process.cwd(),t=e.surveyTypes??He(J),{config:n}=pe({projectRoot:o,surveyTypes:t,instanceId:e.instanceId}),r=ee.join(o,"survey-ui-config.json");return G.writeFileSync(r,JSON.stringify(n,null,2),"utf8"),r}var ue,wt,bt,xe=z(()=>{"use strict";q();Xe();De();Se();Co();ue=l,wt=512e3,bt={".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".svg":"image/svg+xml"}});function W(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function h(e,o){return typeof e=="number"&&Number.isFinite(e)?e:o}function a(e,o){return typeof e=="string"&&e.length?e:o}function _t(){return{"--cfm-header-brand-gap":"16px","--cfm-header-padding-y":"12px","--cfm-header-company-margin-top":"0","--cfm-header-company-margin-left":"0","--cfm-header-company-margin-right":"0","--cfm-header-logo-col":"1","--cfm-header-logo-justify":"start"}}function jt(){return{"--cfm-footer-inner-display":"grid","--cfm-footer-inner-direction":"row","--cfm-footer-logo-col":"1","--cfm-footer-logo-justify":"start","--cfm-footer-links-col":"3","--cfm-footer-links-justify":"end","--cfm-footer-logo-copyright-gap":"12px"}}function Me(e,o){o.numberLabelMode&&(e["--cfm-number-label-mode"]=a(o.numberLabelMode,"traffic")),o.monochromeNumberColor&&(e["--cfm-number-mono-color"]=a(o.monochromeNumberColor,"#9CA3AF"));let t=o.individualNumberColors;Array.isArray(t)&&t.forEach((n,r)=>{typeof n=="string"&&(e[`--cfm-number-color-${r}`]=n)})}function jo(e,o){o.hintLabelColor&&(e["--cfm-hint-label-color"]=a(o.hintLabelColor,"#6B7280")),o.hintLabelBgColor&&(e["--cfm-hint-label-bg"]=a(o.hintLabelBgColor,"transparent"))}function Be(e,o,t){(t==="matrix"||t==="csat")&&(o.columnLabelColor&&(e["--cfm-matrix-column-label-color"]=a(o.columnLabelColor,"#4B5563")),o.columnLabelBgColor&&(e["--cfm-matrix-column-label-bg"]=a(o.columnLabelBgColor,"transparent"))),t==="csat"&&(o.columnLabelColor&&(e["--cfm-csat-column-label-color"]=a(o.columnLabelColor,"#4B5563")),o.columnLabelBgColor&&(e["--cfm-csat-column-label-bg"]=a(o.columnLabelBgColor,"transparent"))),t==="rating"&&(o.columnLabelColor&&(e["--cfm-rating-column-label-color"]=a(o.columnLabelColor,"#4B5563")),o.columnLabelBgColor&&(e["--cfm-rating-column-label-bg"]=a(o.columnLabelBgColor,"transparent"))),t==="slider"&&(o.columnLabelColor&&(e["--cfm-slider-tick-label-color"]=a(o.columnLabelColor,"#4B5563")),o.columnLabelBgColor&&(e["--cfm-slider-tick-label-bg"]=a(o.columnLabelBgColor,"transparent")))}function Dt(e,o){let t=a(o.optionStyle??o.cardStyle,"outlined");e["--cfm-mcq-border-radius"]=`${h(o.borderRadius,8)}px`,e["--cfm-mcq-option-gap"]=`${h(o.optionGap,8)}px`,e["--cfm-mcq-card-padding"]=`${h(o.optionPadding??o.cardPadding,12)}px`,e["--cfm-mcq-hover-border"]=a(o.hoverBorderColor,"#00B5AD"),e["--cfm-mcq-option-style"]=t,o.filledOptionBg&&(e["--cfm-mcq-filled-bg"]=a(o.filledOptionBg,"#F9FAFB"))}function vt(e,o){e["--cfm-input-radius"]=`${h(o.inputRadius,8)}px`,e["--cfm-input-border"]=a(o.borderColor,"#E5E7EB"),e["--cfm-input-padding"]=`${h(o.inputPadding,12)}px`,e["--cfm-input-height"]=`${h(o.inputHeight,44)}px`,e["--cfm-input-placeholder"]=a(o.placeholderColor,"#9CA3AF")}function Lt(e,o){e["--cfm-nps-cell-size"]=`${h(o.cellSize,40)}px`,e["--cfm-nps-cell-gap"]=`${h(o.cellGap,4)}px`,e["--cfm-nps-button-style"]=a(o.buttonStyle,"standard"),e["--cfm-nps-selected-fill"]=a(o.selectedFill,"#E8F5FD"),e["--cfm-nps-track-bar"]=a(o.trackBarColor,"#F2F2F2"),e["--cfm-nps-track-highlight"]=a(o.trackHighlightColor,"#FBE8F3"),jo(e,o),Me(e,o)}function Mt(e,o){e["--cfm-matrix-row-width"]=`${h(o.rowLabelWidth,180)}px`,e["--cfm-matrix-bipolar-width"]=`${h(o.bipolarColumnWidthPercent,25)}%`,e["--cfm-matrix-cell-padding"]=`${h(o.cellPadding,8)}px`,o.carouselDotColor&&(e["--cfm-matrix-carousel-dot"]=a(o.carouselDotColor,"#2563EB")),Be(e,o,"matrix")}function Bt(e,o){e["--cfm-csat-emoji-size"]=`${h(o.emojiSize,24)}px`,e["--cfm-csat-unselected-opacity"]=String(h(o.unselectedOpacity,.5)),e["--cfm-star-unselected-opacity"]=String(h(o.unselectedStarOpacity??o.unselectedOpacity,.5)),e["--cfm-csat-cell-size"]=`${h(o.cellSize,40)}px`,e["--cfm-csat-tooltip-bg"]=a(o.tooltipBg,"#1F2937"),e["--cfm-csat-accent"]=a(o.accentColor,e["--cfm-accent"]??"#00B5AD"),e["--cfm-matrix-row-width"]=`${h(o.rowLabelWidth,180)}px`,e["--cfm-slider-track"]=a(o.graphicsTrackColor,"#E5E7EB"),e["--cfm-slider-thumb"]=a(o.graphicsThumbColor,e["--cfm-accent"]??"#00B5AD"),Be(e,o,"csat"),Me(e,o)}function Ot(e,o){e["--cfm-star-color"]=a(o.starColor,"#F59E0B"),e["--cfm-badge-color"]=a(o.badgeColor,e["--cfm-primary"]??"#1A1F36"),e["--cfm-csat-emoji-size"]=`${h(o.emojiSize,24)}px`,e["--cfm-star-unselected-opacity"]=String(h(o.unselectedStarOpacity,.5)),e["--cfm-csat-unselected-opacity"]=String(h(o.unselectedStarOpacity,.5)),e["--cfm-matrix-row-width"]=`${h(o.rowLabelWidth,180)}px`,e["--cfm-slider-track"]=a(o.graphicsTrackColor,"#E5E7EB"),e["--cfm-slider-thumb"]=a(o.graphicsThumbColor,e["--cfm-primary"]??"#1A1F36"),Be(e,o,"rating"),Me(e,o)}function Ut(e,o){e["--cfm-slider-track"]=a(o.trackColor,e["--cfm-accent"]??"#00B5AD"),e["--cfm-slider-thumb"]=a(o.thumbColor,e["--cfm-primary"]??"#1A1F36"),e["--cfm-slider-tick"]=a(o.tickColor,"#9CA3AF"),e["--cfm-matrix-row-width"]=`${h(o.rowLabelWidth,180)}px`,e["--cfm-slider-row-band"]=a(o.rowBandColor,e["--cfm-row-band"]??"#F3F4F6"),e["--cfm-slider-tick-size"]=`${h(o.tickBadgeSize,28)}px`,Be(e,o,"slider"),jo(e,o),Me(e,o)}function zt(e,o){e["--cfm-upload-border-color"]=a(o.borderColor??o.accentColor,"#D1D5DB"),e["--cfm-upload-padding"]=`${h(o.dropzonePadding,24)}px`,e["--cfm-upload-fill"]=a(o.dropzoneFillColor,"#F9FAFB"),e["--cfm-upload-border-style"]=a(o.dropzoneStyle,"dashed")}function qt(e,o){e["--cfm-media-max-width"]=`${h(o.mediaMaxWidth,100)}%`,e["--cfm-media-radius"]=`${h(o.mediaRadius,8)}px`,e["--cfm-media-caption-color"]=a(o.captionColor,"#6B7280"),e["--cfm-media-caption-size"]=`${h(o.captionSize,14)}px`}function Wt(e,o){e["--cfm-heatmap-pin"]=a(o.pinColor,e["--cfm-accent"]??"#00B5AD"),e["--cfm-heatmap-pin-size"]=`${h(o.pinSize,12)}px`,e["--cfm-heatmap-pin-border"]=a(o.pinBorderColor,"#FFFFFF"),e["--cfm-heatmap-overlay-opacity"]=String(h(o.overlayOpacity,0))}function Xt(e,o){let t=W(o.drag)??o,n=W(o.dropdown)??t;e["--cfm-rank-item-bg"]=a(t.itemBg,"#F9FAFB"),e["--cfm-rank-badge-bg"]=a(t.rankBadgeColor,e["--cfm-primary"]??"#1A1F36"),e["--cfm-rank-badge-text"]="#ffffff",e["--cfm-rank-badge"]=a(t.rankBadgeColor,e["--cfm-primary"]??"#1A1F36"),e["--cfm-rank-item-padding"]=`${h(t.itemPadding,12)}px`,e["--cfm-rank-item-gap"]=`${h(t.itemGap,8)}px`,e["--cfm-rank-handle"]=a(t.dragHandleColor,"#9CA3AF"),e["--cfm-rank-select-border"]=a(n.selectBorderColor,"#E5E7EB")}function Oe(e){let o=W(e.global)??{},t=W(o.colorScheme)??{},n=W(o.header)??{},r=W(o.footer)??{},i=W(o.theme)??{},s=W(o.layout)??{},c=W(o.typography)??{},d=W(o.motion)??{},g=e.questionTypes??{},b=a(s.fontStyle,"modern"),S=_o[b]??a(c.fontFamily,_o.modern),x=a(s.width,"standard"),k=a(s.borderStyle,"rounded"),E=a(i.cellSelectedColor,a(t.accent,"#00B5AD")),$=a(i.focusRingColor,a(t.accent,"#00B5AD")),f=a(i.selectedBackground,a(t.secondary,"#E8F5FD")),y={"--cfm-primary":a(t.primary,"#1A1F36"),"--cfm-secondary":a(t.secondary,"#E8F5FD"),"--cfm-accent":a(t.accent,"#00B5AD"),"--cfm-background":a(i.pageBackground??t.background,"#FFFFFF"),"--cfm-text":a(t.text,"#1A1F36"),"--cfm-button-text":a(t.buttonText,"#FFFFFF"),"--cfm-max-width":Io[x]??Io.standard,"--cfm-border-radius":No[k]??No.rounded,"--cfm-font-family":S,"--cfm-heading-weight":String(h(c.headingWeight,700)),"--cfm-motion-duration":`${h(d.durationMs,200)}ms`,"--cfm-header-height":`${h(n.height,120)}px`,"--cfm-header-logo-width":`${h(n.logoBoxWidth,120)}px`,"--cfm-header-logo-height":`${h(n.logoBoxHeight,120)}px`,"--cfm-header-logo-padding":`${h(n.logoPadding,10)}px`,"--cfm-header-show-company":n.showCompanyName===!1?"0":"1","--cfm-header-bg":a(n.backgroundColor,"#FFFFFF"),"--cfm-header-company-color":a(n.companyNameColor,a(t.text,"#1A1F36")),"--cfm-header-company-size":`${h(n.companyNameFontSize,18)}px`,"--cfm-header-company-weight":String(h(n.companyNameFontWeight,600)),"--cfm-header-border":a(n.borderBottomColor,"#E5E7EB"),"--cfm-header-padding-x":`${h(n.contentPaddingX,40)}px`,"--cfm-header-shadow":n.shadowEnabled===!1?"none":"0 2px 8px rgba(0,0,0,0.06)",..._t(),"--cfm-footer-bg":a(r.backgroundColor,"#262626"),"--cfm-footer-text":a(r.textColor,"#9CA3AF"),"--cfm-footer-link":a(r.linkColor,"#9CA3AF"),"--cfm-footer-link-hover":a(r.linkHoverColor,"#FFFFFF"),"--cfm-footer-logo-width":`${h(r.logoWidth,120)}px`,"--cfm-footer-logo-height":`${h(r.logoHeight,32)}px`,"--cfm-footer-padding-y":`${h(r.paddingY,24)}px`,"--cfm-footer-padding-x":`${h(r.paddingX,40)}px`,...jt(),"--cfm-card-bg":a(i.cardBackground,"#FFFFFF"),"--cfm-card-border-color":a(i.cardBorderColor,"#E5E7EB"),"--cfm-card-padding":`${h(i.cardPadding,24)}px`,"--cfm-card-gap":"32px","--cfm-card-shadow":i.cardShadowEnabled===!1?"none":`0 ${h(i.cardShadowOffsetY,1)}px ${h(i.cardShadowBlur,3)}px ${a(i.cardShadowColor,"rgba(0,0,0,0.1)")}`,"--cfm-selected-bg":f,"--cfm-mcq-selected-accent":$,"--cfm-mcq-selected-bg":f,"--cfm-matrix-selected":E,"--cfm-csat-ring-color":E,"--cfm-input-focus-ring":$,"--cfm-zebra-row":a(i.zebraRowColor,"rgba(249,250,251,0.8)"),"--cfm-row-band":a(i.rowBandColor,"#F3F4F6"),"--cfm-validation-border":a(i.validationBorder,"#333333"),"--cfm-validation-bg":a(i.validationBackground,"#D9D9D9"),"--cfm-tooltip-bg":a(i.tooltipBackground,"#1F2937"),"--cfm-progress-height":`${h(i.progressTrackHeight,12)}px`,"--cfm-progress-track":a(i.progressTrackColor,"#E5E7EB"),"--cfm-progress-fill":a(i.progressFillColor,a(t.primary,"#1A1F36")),"--cfm-sticky-pt":`${h(i.stickyChromePaddingTop,16)}px`,"--cfm-sticky-pb":`${h(i.stickyChromePaddingBottom,20)}px`,"--cfm-language-bg":a(i.languageSelectorBackground,"#FFFFFF"),"--cfm-language-text":a(i.languageSelectorTextColor,"#2563EB"),"--cfm-language-border":a(i.languageSelectorBorderColor,"#2563EB")},T=[["MCQ",Dt],["TEXTFIELD",vt],["NPS_SCALE",Lt],["CFM_MATRIX",Mt],["CSAT_MATRIX",Bt],["RATING_MATRIX",Ot],["SLIDER_MATRIX",Ut],["FILE_UPLOAD",zt],["TEXT_AND_MEDIA",qt],["HEATMAP",Wt],["RANK_ORDER",Xt]];for(let[R,w]of T){let F=W(g[R]);F&&w(y,F)}return y}function Ze(e){let o=e.questionTypes??{},t=W(o.MCQ),n=W(o.NPS_SCALE),r=W(o.FILE_UPLOAD),i={};return i["data-cfm-mcq-style"]=a(t?.optionStyle??t?.cardStyle,"outlined"),n?.buttonStyle&&(i["data-cfm-nps-button-style"]=a(n.buttonStyle,"standard")),r?.dropzoneStyle&&(i["data-cfm-dropzone-style"]=a(r.dropzoneStyle,"dashed")),i}var Io,No,_o,eo=z(()=>{"use strict";Io={narrow:"36rem",standard:"48rem",wide:"64rem"},No={sharp:"0px",rounded:"12px",pill:"9999px"},_o={system:'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',inter:"Inter, system-ui, sans-serif",modern:"Inter, sans-serif",roboto:"Roboto, system-ui, sans-serif",openSans:'"Open Sans", system-ui, sans-serif',lato:"Lato, system-ui, sans-serif",poppins:"Poppins, system-ui, sans-serif",montserrat:"Montserrat, system-ui, sans-serif",nunito:"Nunito, system-ui, sans-serif",raleway:"Raleway, system-ui, sans-serif",sourceSans:'"Source Sans 3", system-ui, sans-serif',georgia:'Georgia, "Times New Roman", serif',serif:"Georgia, serif",merriweather:"Merriweather, Georgia, serif",playfair:'"Playfair Display", Georgia, serif'}});import*as oe from"fs";import*as se from"path";function Ht(e){return`:root {
|
|
3
3
|
${Object.entries(e).sort(([t],[n])=>t.localeCompare(n)).map(([t,n])=>` ${t}: ${n};`).join(`
|
|
4
4
|
`)}
|
|
5
5
|
}`}function Vt(e,o){let t=Oe(e),n=Ht(t),r=o.match(/:root\s*\{[\s\S]*?\n\}/);return r?o.replace(r[0],n):`${n}
|
package/package.json
CHANGED
|
@@ -26,8 +26,14 @@ function anchorLabelStyle(question: CsatMatrixQuestion) {
|
|
|
26
26
|
return question.type === 'RATING_MATRIX' ? ratingColumnLabelStyle() : csatColumnLabelStyle();
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
function columnHeaderLabelStyle(
|
|
30
|
-
|
|
29
|
+
function columnHeaderLabelStyle(question: CsatMatrixQuestion) {
|
|
30
|
+
const pillStyle = question.type === 'RATING_MATRIX' ? ratingColumnLabelStyle() : csatColumnLabelStyle();
|
|
31
|
+
return { fontSize: '13px', fontWeight: 500, textAlign: 'center' as const, lineHeight: 1.2, ...pillStyle };
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function graphicsColumnLabelStyle(question: CsatMatrixQuestion) {
|
|
35
|
+
const pillStyle = question.type === 'RATING_MATRIX' ? ratingColumnLabelStyle() : csatColumnLabelStyle();
|
|
36
|
+
return { fontSize: '12px', fontWeight: 500, lineHeight: 1.2, wordBreak: 'break-word' as const, ...pillStyle };
|
|
31
37
|
}
|
|
32
38
|
|
|
33
39
|
function GraphicsColumnLabelsRow({
|
|
@@ -38,13 +44,7 @@ function GraphicsColumnLabelsRow({
|
|
|
38
44
|
question: CsatMatrixQuestion;
|
|
39
45
|
}) {
|
|
40
46
|
if (scaleColumns.length === 0) return null;
|
|
41
|
-
const labelStyle =
|
|
42
|
-
fontSize: '12px',
|
|
43
|
-
fontWeight: 500,
|
|
44
|
-
lineHeight: 1.2,
|
|
45
|
-
wordBreak: 'break-word' as const,
|
|
46
|
-
color: '#4b5563',
|
|
47
|
-
};
|
|
47
|
+
const labelStyle = graphicsColumnLabelStyle(question);
|
|
48
48
|
|
|
49
49
|
return (
|
|
50
50
|
<div style={{ flex: 1, padding: '0 24px' }}>
|
|
@@ -256,8 +256,8 @@ function CsatMatrixGrid({
|
|
|
256
256
|
</div>
|
|
257
257
|
)}
|
|
258
258
|
|
|
259
|
-
{/* Column Headers for non-graphics
|
|
260
|
-
{!isGraphics &&
|
|
259
|
+
{/* Column Headers for non-graphics when no anchor labels */}
|
|
260
|
+
{!isGraphics && !showLabels && m > 0 && (
|
|
261
261
|
<div style={{ display: 'flex', alignItems: 'flex-end', marginBottom: '16px', minHeight: '24px' }}>
|
|
262
262
|
<div style={{ width: MATRIX_ROW_LABEL_WIDTH, flexShrink: 0 }} />
|
|
263
263
|
<div style={{ flex: 1, display: 'flex' }}>
|
|
@@ -364,16 +364,13 @@ function CsatMatrixGrid({
|
|
|
364
364
|
...(isSelected
|
|
365
365
|
? scaleCellSelectedStyle(true)
|
|
366
366
|
: {
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
367
|
+
border: '1px solid #d1d5db',
|
|
368
|
+
backgroundColor: '#fff',
|
|
369
|
+
color: '#111827',
|
|
370
|
+
...unselectedOpacityStyle(),
|
|
371
|
+
}),
|
|
372
372
|
transition: 'all 0.15s',
|
|
373
|
-
} : {
|
|
374
|
-
padding: '8px',
|
|
375
|
-
...(isSelected ? {} : unselectedOpacityStyle()),
|
|
376
|
-
}),
|
|
373
|
+
} : { padding: '8px', ...(!isSelected ? unselectedOpacityStyle() : {}) }),
|
|
377
374
|
}}
|
|
378
375
|
>
|
|
379
376
|
{(EmojiNode ?? StarNode ?? (isNumbered ? (displayIdx + 1) : RadioNode)) as React.ReactNode}
|
|
@@ -539,8 +536,13 @@ function CsatMatrixCarousel({
|
|
|
539
536
|
width: '40px', height: '40px', borderRadius: '8px', fontSize: '14px', fontWeight: 500,
|
|
540
537
|
...(isSelected
|
|
541
538
|
? scaleCellSelectedStyle(true)
|
|
542
|
-
: {
|
|
543
|
-
|
|
539
|
+
: {
|
|
540
|
+
border: '1px solid #d1d5db',
|
|
541
|
+
backgroundColor: '#fff',
|
|
542
|
+
color: '#111827',
|
|
543
|
+
...unselectedOpacityStyle(),
|
|
544
|
+
}),
|
|
545
|
+
} : { padding: '8px', ...(!isSelected ? unselectedOpacityStyle() : {}) }),
|
|
544
546
|
}}
|
|
545
547
|
>
|
|
546
548
|
{(EmojiNode ?? StarNode ?? (isNumbered ? (displayIdx + 1) : RadioNode)) as React.ReactNode}
|
|
@@ -76,11 +76,12 @@ export default function Header({ embedded = false }: HeaderProps) {
|
|
|
76
76
|
{seedCompany}
|
|
77
77
|
</span>
|
|
78
78
|
|
|
79
|
-
{
|
|
79
|
+
{seedCompany ? (
|
|
80
80
|
<span
|
|
81
81
|
data-cfm-company
|
|
82
82
|
className="font-semibold"
|
|
83
83
|
style={{
|
|
84
|
+
display: hasLogoFile && seedShowCompany ? undefined : 'none',
|
|
84
85
|
color: 'var(--cfm-header-company-color, var(--cfm-text))',
|
|
85
86
|
fontSize: 'var(--cfm-header-company-size, 18px)',
|
|
86
87
|
fontWeight: 'var(--cfm-header-company-weight, 600)',
|
|
@@ -19,6 +19,7 @@ import { FileUploadScale } from './FileUploadScale';
|
|
|
19
19
|
import { HeatmapScale } from './HeatmapScale';
|
|
20
20
|
import { RankOrderScale } from './RankOrderScale';
|
|
21
21
|
import RatingScale from './RatingScale';
|
|
22
|
+
import { getLayoutFlags } from '@/lib/uiConfig';
|
|
22
23
|
import { hintLabelStyle } from '@/lib/surveyUi/labelStyles';
|
|
23
24
|
import {
|
|
24
25
|
mcqCheckboxControlStyle,
|
|
@@ -47,6 +48,8 @@ export default function Question({
|
|
|
47
48
|
customFieldValues = {},
|
|
48
49
|
onSelect,
|
|
49
50
|
}: QuestionProps) {
|
|
51
|
+
const { showQuestionNumbers, showRequiredAsterisk } = getLayoutFlags();
|
|
52
|
+
|
|
50
53
|
const questionsById = useMemo(
|
|
51
54
|
() => new Map(allQuestions.map(q => [q.id, q])),
|
|
52
55
|
[allQuestions]
|
|
@@ -129,13 +132,21 @@ export default function Question({
|
|
|
129
132
|
style={{ color: 'var(--cfm-text, #111827)' }}
|
|
130
133
|
>
|
|
131
134
|
{question.questionNumber != null && (
|
|
132
|
-
<span
|
|
135
|
+
<span
|
|
136
|
+
data-cfm-question-number
|
|
137
|
+
className="mr-1 font-semibold"
|
|
138
|
+
style={{ display: showQuestionNumbers ? undefined : 'none' }}
|
|
139
|
+
>
|
|
133
140
|
{question.questionNumber}.
|
|
134
141
|
</span>
|
|
135
142
|
)}
|
|
136
143
|
<span dangerouslySetInnerHTML={{ __html: displayQuestionText }} />
|
|
137
144
|
{question.required && (
|
|
138
|
-
<span
|
|
145
|
+
<span
|
|
146
|
+
data-cfm-required
|
|
147
|
+
className="ml-1 text-red-500"
|
|
148
|
+
style={{ display: showRequiredAsterisk ? undefined : 'none' }}
|
|
149
|
+
>
|
|
139
150
|
*
|
|
140
151
|
</span>
|
|
141
152
|
)}
|
|
@@ -104,7 +104,6 @@ export function SliderMatrixScale({ question, selectedValue = {}, onSelect }: Sl
|
|
|
104
104
|
fontSize: '14px',
|
|
105
105
|
fontWeight: 400,
|
|
106
106
|
height: '28px',
|
|
107
|
-
...sliderTickLabelStyle(),
|
|
108
107
|
}}
|
|
109
108
|
>
|
|
110
109
|
{tickValues.length > 0 ? (
|
|
@@ -117,7 +116,7 @@ export function SliderMatrixScale({ question, selectedValue = {}, onSelect }: Sl
|
|
|
117
116
|
width: `${sliceWidth}%`, display: 'flex', justifyContent: 'center',
|
|
118
117
|
}}>
|
|
119
118
|
{sliderType === 'graphics' ? (
|
|
120
|
-
<div style={{ wordBreak: 'break-word', textAlign: 'center', lineHeight: '1.2', fontWeight: 500,
|
|
119
|
+
<div style={{ ...sliderTickLabelStyle(), wordBreak: 'break-word', textAlign: 'center', lineHeight: '1.2', fontWeight: 500, fontSize: '13px' }}>
|
|
121
120
|
{tv.label}
|
|
122
121
|
</div>
|
|
123
122
|
) : (
|
|
@@ -150,7 +149,7 @@ export function SliderMatrixScale({ question, selectedValue = {}, onSelect }: Sl
|
|
|
150
149
|
position: 'absolute', left: `${percentage}%`, transform: 'translateX(-50%)',
|
|
151
150
|
width: `${sliceWidth}%`, display: 'flex', justifyContent: 'center',
|
|
152
151
|
}}>
|
|
153
|
-
<span style={{ wordBreak: 'break-word', textAlign: 'center', lineHeight: '1.2' }}>{m}</span>
|
|
152
|
+
<span style={{ ...sliderTickLabelStyle(), wordBreak: 'break-word', textAlign: 'center', lineHeight: '1.2' }}>{m}</span>
|
|
154
153
|
</div>
|
|
155
154
|
);
|
|
156
155
|
})
|
|
@@ -17,8 +17,10 @@ export function getCompanyName(): string {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
export function getLogoFileName(): string | null {
|
|
20
|
-
const fileName = surveyUiConfig.global?.logo?.fileName;
|
|
21
|
-
|
|
20
|
+
const fileName = surveyUiConfig.global?.logo?.fileName as string | null | undefined;
|
|
21
|
+
if (typeof fileName !== 'string') return null;
|
|
22
|
+
const trimmed = fileName.trim();
|
|
23
|
+
return trimmed ? trimmed : null;
|
|
22
24
|
}
|
|
23
25
|
|
|
24
26
|
/** Logo src for Header/Footer img — relative for AWS static export. */
|
|
@@ -104,8 +104,8 @@
|
|
|
104
104
|
}
|
|
105
105
|
});
|
|
106
106
|
document.querySelectorAll('[data-cfm-company]').forEach(function (el) {
|
|
107
|
-
if (patch.logoUrl) {
|
|
108
|
-
el.style.display =
|
|
107
|
+
if (patch.logoUrl && !el.textContent) {
|
|
108
|
+
el.style.display = 'none';
|
|
109
109
|
}
|
|
110
110
|
});
|
|
111
111
|
}
|
|
@@ -113,7 +113,9 @@
|
|
|
113
113
|
var name = patch.companyName || '';
|
|
114
114
|
document.querySelectorAll('[data-cfm-company]').forEach(function (el) {
|
|
115
115
|
el.textContent = name;
|
|
116
|
-
|
|
116
|
+
if (!name) {
|
|
117
|
+
el.style.display = 'none';
|
|
118
|
+
}
|
|
117
119
|
});
|
|
118
120
|
document.querySelectorAll('[data-cfm-logo-text]').forEach(function (el) {
|
|
119
121
|
var logoImg = document.querySelector('[data-cfm-logo]');
|
|
@@ -19,19 +19,6 @@ const LIKERT_COLUMNS = [
|
|
|
19
19
|
{ id: 'c5', label: 'Strongly Agree' },
|
|
20
20
|
];
|
|
21
21
|
|
|
22
|
-
const MATRIX_ANCHOR_LABELS = [
|
|
23
|
-
'Strongly Disagree',
|
|
24
|
-
'Disagree',
|
|
25
|
-
'Neutral',
|
|
26
|
-
'Agree',
|
|
27
|
-
'Strongly Agree',
|
|
28
|
-
];
|
|
29
|
-
|
|
30
|
-
const SCALE_COLUMNS_10 = Array.from({ length: 10 }, (_, i) => ({
|
|
31
|
-
id: `c${i}`,
|
|
32
|
-
label: String(i + 1),
|
|
33
|
-
}));
|
|
34
|
-
|
|
35
22
|
const MATRIX_ROW_SINGLE = [{ id: 'r1', statementText: 'Statement Item 1' }];
|
|
36
23
|
|
|
37
24
|
const MATRIX_ROWS_MULTI = [
|
|
@@ -217,13 +204,20 @@ export const FIXTURE_CFM_DROPDOWN = base({
|
|
|
217
204
|
scaleColumns: LIKERT_COLUMNS,
|
|
218
205
|
});
|
|
219
206
|
|
|
207
|
+
const LIKERT_ANCHOR_LABELS = LIKERT_COLUMNS.map((c) => c.label);
|
|
208
|
+
|
|
209
|
+
const RATING_TEN_COLUMNS = Array.from({ length: 10 }, (_, i) => ({
|
|
210
|
+
id: `c${i}`,
|
|
211
|
+
label: String(i + 1),
|
|
212
|
+
}));
|
|
213
|
+
|
|
220
214
|
export const FIXTURE_CSAT_EMOJI = base({
|
|
221
215
|
type: 'CSAT_MATRIX',
|
|
222
216
|
displayStyle: 'emoji',
|
|
223
217
|
gridLayout: 'standard',
|
|
224
218
|
statementRows: MATRIX_ROW_SINGLE,
|
|
225
|
-
scaleColumns:
|
|
226
|
-
scaleAnchorLabels:
|
|
219
|
+
scaleColumns: LIKERT_COLUMNS,
|
|
220
|
+
scaleAnchorLabels: LIKERT_ANCHOR_LABELS,
|
|
227
221
|
});
|
|
228
222
|
|
|
229
223
|
export const FIXTURE_CSAT_STAR = base({
|
|
@@ -231,8 +225,8 @@ export const FIXTURE_CSAT_STAR = base({
|
|
|
231
225
|
displayStyle: 'star',
|
|
232
226
|
gridLayout: 'standard',
|
|
233
227
|
statementRows: MATRIX_ROW_SINGLE,
|
|
234
|
-
scaleColumns:
|
|
235
|
-
scaleAnchorLabels:
|
|
228
|
+
scaleColumns: LIKERT_COLUMNS,
|
|
229
|
+
scaleAnchorLabels: LIKERT_ANCHOR_LABELS,
|
|
236
230
|
});
|
|
237
231
|
|
|
238
232
|
export const FIXTURE_CSAT_NUMBERED = base({
|
|
@@ -240,8 +234,8 @@ export const FIXTURE_CSAT_NUMBERED = base({
|
|
|
240
234
|
displayStyle: 'numbered',
|
|
241
235
|
gridLayout: 'standard',
|
|
242
236
|
statementRows: MATRIX_ROWS_MULTI,
|
|
243
|
-
scaleColumns:
|
|
244
|
-
scaleAnchorLabels:
|
|
237
|
+
scaleColumns: LIKERT_COLUMNS,
|
|
238
|
+
scaleAnchorLabels: LIKERT_ANCHOR_LABELS,
|
|
245
239
|
});
|
|
246
240
|
|
|
247
241
|
export const FIXTURE_CSAT_GRAPHICS = base({
|
|
@@ -249,8 +243,8 @@ export const FIXTURE_CSAT_GRAPHICS = base({
|
|
|
249
243
|
displayStyle: 'graphics',
|
|
250
244
|
gridLayout: 'standard',
|
|
251
245
|
statementRows: MATRIX_ROW_SINGLE,
|
|
252
|
-
scaleColumns:
|
|
253
|
-
scaleAnchorLabels:
|
|
246
|
+
scaleColumns: LIKERT_COLUMNS,
|
|
247
|
+
scaleAnchorLabels: LIKERT_ANCHOR_LABELS,
|
|
254
248
|
});
|
|
255
249
|
|
|
256
250
|
export const FIXTURE_CSAT_CAROUSEL = base({
|
|
@@ -280,8 +274,8 @@ export const FIXTURE_RATING_STAR = base({
|
|
|
280
274
|
gridLayout: 'standard',
|
|
281
275
|
showColumnHeaders: true,
|
|
282
276
|
statementRows: MATRIX_ROWS_MULTI,
|
|
283
|
-
scaleColumns:
|
|
284
|
-
scaleAnchorLabels:
|
|
277
|
+
scaleColumns: RATING_TEN_COLUMNS,
|
|
278
|
+
scaleAnchorLabels: LIKERT_ANCHOR_LABELS,
|
|
285
279
|
});
|
|
286
280
|
|
|
287
281
|
export const FIXTURE_RATING_NUMBERED = base({
|
|
@@ -289,8 +283,8 @@ export const FIXTURE_RATING_NUMBERED = base({
|
|
|
289
283
|
displayStyle: 'numbered',
|
|
290
284
|
gridLayout: 'standard',
|
|
291
285
|
statementRows: MATRIX_ROWS_MULTI,
|
|
292
|
-
scaleColumns:
|
|
293
|
-
scaleAnchorLabels:
|
|
286
|
+
scaleColumns: RATING_TEN_COLUMNS,
|
|
287
|
+
scaleAnchorLabels: LIKERT_ANCHOR_LABELS,
|
|
294
288
|
});
|
|
295
289
|
|
|
296
290
|
export const FIXTURE_RATING_RADIO = base({
|
|
@@ -298,8 +292,8 @@ export const FIXTURE_RATING_RADIO = base({
|
|
|
298
292
|
displayStyle: 'standard',
|
|
299
293
|
gridLayout: 'standard',
|
|
300
294
|
statementRows: MATRIX_ROW_SINGLE,
|
|
301
|
-
scaleColumns:
|
|
302
|
-
scaleAnchorLabels:
|
|
295
|
+
scaleColumns: RATING_TEN_COLUMNS,
|
|
296
|
+
scaleAnchorLabels: LIKERT_ANCHOR_LABELS,
|
|
303
297
|
});
|
|
304
298
|
|
|
305
299
|
export const FIXTURE_RATING_EMOJI = base({
|
|
@@ -307,8 +301,8 @@ export const FIXTURE_RATING_EMOJI = base({
|
|
|
307
301
|
displayStyle: 'emoji',
|
|
308
302
|
gridLayout: 'standard',
|
|
309
303
|
statementRows: MATRIX_ROW_SINGLE,
|
|
310
|
-
scaleColumns:
|
|
311
|
-
scaleAnchorLabels:
|
|
304
|
+
scaleColumns: RATING_TEN_COLUMNS,
|
|
305
|
+
scaleAnchorLabels: LIKERT_ANCHOR_LABELS,
|
|
312
306
|
});
|
|
313
307
|
|
|
314
308
|
export const FIXTURE_RATING_GRAPHICS = base({
|
|
@@ -316,8 +310,8 @@ export const FIXTURE_RATING_GRAPHICS = base({
|
|
|
316
310
|
displayStyle: 'graphics',
|
|
317
311
|
gridLayout: 'standard',
|
|
318
312
|
statementRows: MATRIX_ROW_SINGLE,
|
|
319
|
-
scaleColumns:
|
|
320
|
-
scaleAnchorLabels:
|
|
313
|
+
scaleColumns: RATING_TEN_COLUMNS,
|
|
314
|
+
scaleAnchorLabels: LIKERT_ANCHOR_LABELS,
|
|
321
315
|
});
|
|
322
316
|
|
|
323
317
|
export const FIXTURE_RATING_SLIDER = base({
|
|
@@ -91,7 +91,9 @@ function applyContentPatch(patch: ContentPatch): void {
|
|
|
91
91
|
document.querySelectorAll('[data-cfm-company]').forEach((el) => {
|
|
92
92
|
const htmlEl = el as HTMLElement;
|
|
93
93
|
if (patch.logoUrl) {
|
|
94
|
-
|
|
94
|
+
if (!htmlEl.textContent?.trim()) {
|
|
95
|
+
htmlEl.style.display = 'none';
|
|
96
|
+
}
|
|
95
97
|
}
|
|
96
98
|
});
|
|
97
99
|
}
|
|
@@ -100,7 +102,9 @@ function applyContentPatch(patch: ContentPatch): void {
|
|
|
100
102
|
const name = patch.companyName ?? '';
|
|
101
103
|
document.querySelectorAll('[data-cfm-company]').forEach((el) => {
|
|
102
104
|
(el as HTMLElement).textContent = name;
|
|
103
|
-
(
|
|
105
|
+
if (!name) {
|
|
106
|
+
(el as HTMLElement).style.display = 'none';
|
|
107
|
+
}
|
|
104
108
|
});
|
|
105
109
|
document.querySelectorAll('[data-cfm-logo-text]').forEach((el) => {
|
|
106
110
|
const logoImg = document.querySelector('[data-cfm-logo]') as HTMLImageElement | null;
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
--cfm-footer-link-hover: #ffffff;
|
|
38
38
|
--cfm-footer-logo-width: 120px;
|
|
39
39
|
--cfm-footer-logo-height: 32px;
|
|
40
|
-
--cfm-footer-padding-y:
|
|
40
|
+
--cfm-footer-padding-y: 21px;
|
|
41
41
|
--cfm-footer-padding-x: 40px;
|
|
42
42
|
--cfm-footer-logo-copyright-gap: 12px;
|
|
43
43
|
--cfm-footer-inner-display: grid;
|