Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@calcom/embed-core

Package Overview
Dependencies
Maintainers
3
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@calcom/embed-core - npm Package Compare versions

Comparing version 1.1.3 to 1.1.4

CHANGELOG.md

23

dist/embed/embed.js

@@ -1,2 +0,2 @@

!function(){const v=({buttonText:s,buttonClasses:t,buttonColor:r,buttonTextColor:e})=>`<button class="z-[10000000000] hidden fixed md:bottom-6 bottom-4 md:right-10 right-4 md:left-10 left-4 ${t.join(" ")} flex h-16 origin-center bg-red-50 transform cursor-pointer items-center
!function(){const v=({buttonText:n,buttonClasses:t,buttonColor:r,buttonTextColor:e})=>`<button class="z-[10000000000] hidden fixed md:bottom-6 bottom-4 md:right-10 right-4 md:left-10 left-4 ${t.join(" ")} flex h-16 origin-center bg-red-50 transform cursor-pointer items-center
rounded-full py-4 px-6 text-base outline-none drop-shadow-md transition focus:outline-none fo

@@ -19,6 +19,6 @@ cus:ring-4 focus:ring-gray-600 focus:ring-opacity-50 active:scale-95"

</div>
<div id="button" class="font-semibold leading-5 antialiased">${s}</div>
</button>`;class w extends HTMLElement{static updatedClassString(t,r){return[r.replace(/hidden|md:right-10|md:left-10|left-4|right-4/g,""),t==="bottom-right"?"md:right-10 right-4":"md:left-10 left-4"].join(" ")}static get observedAttributes(){return["data-button-text","data-hide-button-icon","data-button-position","data-button-color","data-button-text-color"]}attributeChangedCallback(t,r,e){var o,i,n,l,d;if(t==="data-button-text"){const a=(o=this.shadowRoot)==null?void 0:o.querySelector("#button");if(!a)throw new Error("Button not found");a.innerHTML=e}else if(t==="data-hide-button-icon"){const a=(i=this.shadowRoot)==null?void 0:i.querySelector("#button-icon");if(!a)throw new Error("Button not found");a.style.display=e=="true"?"none":"block"}else if(t==="data-button-position"){const a=(n=this.shadowRoot)==null?void 0:n.querySelector("button");if(!a)throw new Error("Button not found");a.className=w.updatedClassString(e,a.className)}else if(t==="data-button-color"){const a=(l=this.shadowRoot)==null?void 0:l.querySelector("button");if(!a)throw new Error("Button not found");a.style.backgroundColor=e}else if(t==="data-button-text-color"){const a=(d=this.shadowRoot)==null?void 0:d.querySelector("button");if(!a)throw new Error("Button not found");a.style.color=e}}constructor(){super();const t=this.dataset.buttonText,r=this.dataset.buttonPosition,e=this.dataset.buttonColor,o=this.dataset.buttonTextColor,i=`<style>${window.Cal.__css}</style> ${v({buttonText:t,buttonClasses:[w.updatedClassString(r,"")],buttonColor:e,buttonTextColor:o})}`;this.attachShadow({mode:"open"}),this.shadowRoot.innerHTML=i}}const b=`@keyframes loader{0%{transform:rotate(0)}25%{transform:rotate(180deg)}50%{transform:rotate(180deg)}75%{transform:rotate(360deg)}to{transform:rotate(360deg)}}@keyframes loader-inner{0%{height:0%}25%{height:0%}50%{height:100%}75%{height:100%}to{height:0%}}.loader-inner{vertical-align:top;display:inline-block;width:100%;animation:loader-inner 2s infinite ease-in}.loader{display:block;width:30px;height:30px;position:relative;border-width:4px;border-style:solid;animation:loader 2s infinite ease}.loader.modal-loader{margin:60px auto}
`,y=s=>s==="404"?"Error Code: 404. Cal Link seems to be wrong.":`Error Code: ${s}. Something went wrong.`,E=`<div id="wrapper" style="top:50%; left:50%" class="absolute z-highest">
<div style="transform:translate(-50%,-50%)" class="loader border-brand dark:border-darkmodebrand">
<div id="button" class="font-semibold leading-5 antialiased">${n}</div>
</button>`,E=["data-button-text","data-hide-button-icon","data-button-position","data-button-color","data-button-text-color"];class w extends HTMLElement{constructor(){super();const t=this.dataset,r=t.buttonText,e=t.buttonPosition,o=t.buttonColor,i=t.buttonTextColor,a=`<style>${window.Cal.__css}</style> ${v({buttonText:r,buttonClasses:[w.updatedClassString(e,"")],buttonColor:o,buttonTextColor:i})}`;this.attachShadow({mode:"open"}),this.assertHasShadowRoot(),this.shadowRoot.innerHTML=a}static updatedClassString(t,r){return[r.replace(/hidden|md:right-10|md:left-10|left-4|right-4/g,""),t==="bottom-right"?"md:right-10 right-4":"md:left-10 left-4"].join(" ")}static get observedAttributes(){return E}attributeChangedCallback(t,r,e){var s,l,d;const o=(s=this.shadowRoot)==null?void 0:s.querySelector("#button"),i=(l=this.shadowRoot)==null?void 0:l.querySelector("button"),a=(d=this.shadowRoot)==null?void 0:d.querySelector("#button-icon");if(!o)throw new Error("#button not found");if(!i)throw new Error("button element not found");if(!a)throw new Error("#button-icon not found");t==="data-button-text"?o.textContent=e:t==="data-hide-button-icon"?a.style.display=e=="true"?"none":"block":t==="data-button-position"?i.className=w.updatedClassString(e,i.className):t==="data-button-color"?i.style.backgroundColor=e:t==="data-button-text-color"?i.style.color=e:console.log("Unknown attribute changed",t,r,e)}assertHasShadowRoot(){if(!this.shadowRoot)throw new Error("No shadow root")}}const C=`@keyframes loader{0%{transform:rotate(0)}25%{transform:rotate(180deg)}50%{transform:rotate(180deg)}75%{transform:rotate(360deg)}to{transform:rotate(360deg)}}@keyframes loader-inner{0%{height:0%}25%{height:0%}50%{height:100%}75%{height:100%}to{height:0%}}.loader-inner{vertical-align:top;display:inline-block;width:100%;animation:loader-inner 2s infinite ease-in}.loader{display:block;width:30px;height:30px;position:relative;border-width:4px;border-style:solid;animation:loader 2s infinite ease}.loader.modal-loader{margin:60px auto}
`,y=n=>n==="404"?"Error Code: 404. Cal Link seems to be wrong.":`Error Code: ${n}. Something went wrong.`,S=`<div id="wrapper" style="top:50%; left:50%;transform:translate(-50%,-50%)" class="absolute z-highest">
<div class="loader border-brand-default dark:border-darkmodebrand">
<span class="loader-inner bg-brand dark:bg-darkmodebrand"></span>

@@ -30,3 +30,4 @@ </div>

</div>
<slot></slot>`;class C extends HTMLElement{static get observedAttributes(){return["loading"]}attributeChangedCallback(t,r,e){if(t==="loading"){if(e=="done")this.shadowRoot.querySelector(".loader").style.display="none";else if(e==="failed"){this.shadowRoot.querySelector(".loader").style.display="none",this.shadowRoot.querySelector("#error").style.display="block",this.shadowRoot.querySelector("slot").style.visibility="hidden";const o=y(this.dataset.errorCode);this.shadowRoot.querySelector("#error").innerText=o}}}constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.innerHTML=`<style>${window.Cal.__css}</style><style>${b}</style>${E}`}}const S=`<style>
<slot></slot>`;class z extends HTMLElement{static get observedAttributes(){return["loading"]}assertHasShadowRoot(){if(!this.shadowRoot)throw new Error("No shadow root")}attributeChangedCallback(t,r,e){this.assertHasShadowRoot();const o=this.shadowRoot.querySelector(".loader"),i=this.shadowRoot.querySelector("#error"),a=this.shadowRoot.querySelector("slot");if(!o||!a||!i)throw new Error("One of loaderEl, slotEl or errorEl is missing");if(t==="loading"){if(e=="done")o.style.display="none";else if(e==="failed"){o.style.display="none",a.style.visibility="hidden",i.style.display="block";const s=y(this.dataset.errorCode);i.innerText=s}}}constructor(){super(),this.attachShadow({mode:"open"}),this.assertHasShadowRoot(),this.shadowRoot.innerHTML=`<style>${window.Cal.__css}</style><style>${C}</style>${S}`}}const A=`@keyframes loader{0%{transform:rotate(0)}25%{transform:rotate(180deg)}50%{transform:rotate(180deg)}75%{transform:rotate(360deg)}to{transform:rotate(360deg)}}@keyframes loader-inner{0%{height:0%}25%{height:0%}50%{height:100%}75%{height:100%}to{height:0%}}.loader-inner{vertical-align:top;display:inline-block;width:100%;animation:loader-inner 2s infinite ease-in}.loader{display:block;width:30px;height:30px;position:relative;border-width:4px;border-style:solid;animation:loader 2s infinite ease}.loader.modal-loader{margin:60px auto}
`,R=`<style>
.my-backdrop {

@@ -79,13 +80,13 @@ position:fixed;

<div id="wrapper" class="z-[999999999999] absolute flex w-full items-center">
<div class="loader modal-loader border-brand dark:border-darkmodebrand">
<div class="loader modal-loader border-brand-default dark:border-darkmodebrand">
<span class="loader-inner bg-brand dark:bg-darkmodebrand"></span>
</div>
</div>
<div id="error" class="hidden left-1/2 -translate-x-1/2 relative text-white"></div>
<div id="error" class="hidden left-1/2 -translate-x-1/2 relative text-inverted"></div>
<slot></slot>
</div>
</div>
</div>`;class f extends HTMLElement{static get observedAttributes(){return["state"]}assertHasShadowRoot(){if(!this.shadowRoot)throw new Error("No shadow root")}show(t){this.assertHasShadowRoot(),this.shadowRoot.host.style.visibility=t?"visible":"hidden",t||(document.body.style.overflow=f.htmlOverflow)}close(){this.show(!1)}getLoaderElement(){this.assertHasShadowRoot();const t=this.shadowRoot.querySelector(".loader");if(!t)throw new Error("No loader element");return t}getErrorElement(){this.assertHasShadowRoot();const t=this.shadowRoot.querySelector("#error");if(!t)throw new Error("No error element");return t}attributeChangedCallback(t,r,e){if(t==="state"){if(e=="loaded")this.getLoaderElement().style.display="none";else if(e==="started")this.show(!0);else if(e=="closed")this.show(!1);else if(e==="failed"){this.getLoaderElement().style.display="none",this.getErrorElement().style.display="inline-block";const o=y(this.dataset.errorCode);this.getErrorElement().innerText=o}}}connectedCallback(){this.assertHasShadowRoot();const t=this.shadowRoot.querySelector(".close");document.addEventListener("keydown",r=>{r.key==="Escape"&&this.close()},{once:!0}),this.shadowRoot.host.addEventListener("click",()=>{this.close()}),t&&(t.onclick=()=>{this.close()})}constructor(){super();const t=`<style>${window.Cal.__css}</style><style>${b}</style>${S}`;this.attachShadow({mode:"open"}),f.htmlOverflow=document.body.style.overflow,document.body.style.overflow="hidden",this.assertHasShadowRoot(),this.shadowRoot.innerHTML=t}}const z=`.cal-embed{border:0px;min-height:300px;margin:0 auto;width:100%}
`;function m(s,t){const r=new window.CustomEvent(s,{detail:t});window.dispatchEvent(r)}class k{static parseAction(t){if(!t)return null;const[r,e,o]=t.split(":");return r!=="CAL"?null:{ns:e,type:o}}getFullActionName(t){return this.namespace?`CAL:${this.namespace}:${t}`:`CAL::${t}`}fire(t,r){const e=this.getFullActionName(t),o={type:t,namespace:this.namespace,fullType:e,data:r};m(e,o),m(this.getFullActionName("*"),o)}on(t,r){const e=this.getFullActionName(t);window.addEventListener(e,r)}off(t,r){const e=this.getFullActionName(t);window.removeEventListener(e,r)}constructor(t){t=t||"",this.namespace=t}}const A=`*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:var(--font-inter),ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:Roboto Mono,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}[type=text],[type=email],[type=url],[type=password],[type=number],[type=date],[type=datetime-local],[type=month],[type=search],[type=tel],[type=time],[type=week],[multiple],textarea,select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;border-color:#6b7280;border-width:1px;border-radius:0;padding:.5rem .75rem;font-size:1rem;line-height:1.5rem;--tw-shadow: 0 0 #0000}[type=text]:focus,[type=email]:focus,[type=url]:focus,[type=password]:focus,[type=number]:focus,[type=date]:focus,[type=datetime-local]:focus,[type=month]:focus,[type=search]:focus,[type=tel]:focus,[type=time]:focus,[type=week]:focus,[multiple]:focus,textarea:focus,select:focus{outline:2px solid transparent;outline-offset:2px;--tw-ring-inset: var(--tw-empty, );--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: #238BE6;--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-color:#238be6}input::-moz-placeholder,textarea::-moz-placeholder{color:#6b7280;opacity:1}input::placeholder,textarea::placeholder{color:#6b7280;opacity:1}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-date-and-time-value{min-height:1.5em}::-webkit-datetime-edit,::-webkit-datetime-edit-year-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-meridiem-field{padding-top:0;padding-bottom:0}select{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236B7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");background-position:right .5rem center;background-repeat:no-repeat;background-size:1.5em 1.5em;padding-right:2.5rem;-webkit-print-color-adjust:exact;print-color-adjust:exact}[multiple]{background-image:initial;background-position:initial;background-repeat:unset;background-size:initial;padding-right:.75rem;-webkit-print-color-adjust:unset;print-color-adjust:unset}[type=checkbox],[type=radio]{-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0;-webkit-print-color-adjust:exact;print-color-adjust:exact;display:inline-block;vertical-align:middle;background-origin:border-box;-webkit-user-select:none;-moz-user-select:none;user-select:none;flex-shrink:0;height:1rem;width:1rem;color:#238be6;background-color:#fff;border-color:#6b7280;border-width:1px;--tw-shadow: 0 0 #0000}[type=checkbox]{border-radius:0}[type=radio]{border-radius:100%}[type=checkbox]:focus,[type=radio]:focus{outline:2px solid transparent;outline-offset:2px;--tw-ring-inset: var(--tw-empty, );--tw-ring-offset-width: 2px;--tw-ring-offset-color: #fff;--tw-ring-color: #238BE6;--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}[type=checkbox]:checked,[type=radio]:checked{border-color:transparent;background-color:currentColor;background-size:100% 100%;background-position:center;background-repeat:no-repeat}[type=checkbox]:checked{background-image:url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e")}[type=radio]:checked{background-image:url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8' cy='8' r='3'/%3e%3c/svg%3e")}[type=checkbox]:checked:hover,[type=checkbox]:checked:focus,[type=radio]:checked:hover,[type=radio]:checked:focus{border-color:transparent;background-color:currentColor}[type=checkbox]:indeterminate{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3e%3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 8h8'/%3e%3c/svg%3e");border-color:transparent;background-color:currentColor;background-size:100% 100%;background-position:center;background-repeat:no-repeat}[type=checkbox]:indeterminate:hover,[type=checkbox]:indeterminate:focus{border-color:transparent;background-color:currentColor}[type=file]{background:unset;border-color:inherit;border-width:0;border-radius:0;padding:0;font-size:unset;line-height:inherit}[type=file]:focus{outline:1px solid ButtonText;outline:1px auto -webkit-focus-ring-color}*{scrollbar-color:initial;scrollbar-width:initial}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(51 154 240 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(51 154 240 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.visible{visibility:visible}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.bottom-4{bottom:1rem}.right-4{right:1rem}.left-4{left:1rem}.left-1\\/2{left:50%}.z-\\[10000000000\\]{z-index:10000000000}.z-\\[999999999999\\]{z-index:999999999999}.mr-3{margin-right:.75rem}.flex{display:flex}.hidden{display:none}.h-16{height:4rem}.h-7{height:1.75rem}.w-7{width:1.75rem}.w-full{width:100%}.origin-center{transform-origin:center}.-translate-x-1\\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-pointer{cursor:pointer}.items-center{align-items:center}.justify-center{justify-content:center}.rounded-full{border-radius:9999px}.border-brand{border-color:var(--cal-brand-color, black)}.bg-red-50{--tw-bg-opacity: 1;background-color:rgb(255 245 245 / var(--tw-bg-opacity))}.bg-brand{background-color:var(--cal-brand-color, black)}.py-4{padding-top:1rem;padding-bottom:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.text-base{font-size:1rem;line-height:1.5rem}.font-semibold{font-weight:600}.leading-5{line-height:1.25rem}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.outline-none{outline:2px solid transparent;outline-offset:2px}.drop-shadow-md{--tw-drop-shadow: drop-shadow(0 4px 3px rgb(0 0 0 / .07)) drop-shadow(0 2px 2px rgb(0 0 0 / .06));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}@font-face{font-family:Cal Sans;src:url(https://cal.com/cal.ttf)}h1,h2,h3,h4,h5,h6{font-family:Cal Sans;font-weight:400;letter-spacing:normal}html,body,:host{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\\:ring-gray-600:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(75 85 99 / var(--tw-ring-opacity))}.focus\\:ring-opacity-50:focus{--tw-ring-opacity: .5}.active\\:scale-95:active{--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.dark .dark\\:border-darkmodebrand{border-color:var(--brand-color-dark-mode)}.dark .dark\\:bg-darkmodebrand{background-color:var(--brand-color-dark-mode)}@media (min-width: 768px){.md\\:bottom-6{bottom:1.5rem}.md\\:right-10{right:2.5rem}.md\\:left-10{left:2.5rem}}
`,L="https://app.cal.com";customElements.define("cal-modal-box",f);customElements.define("cal-floating-button",w);customElements.define("cal-inline",C);const c=window.Cal;if(!c||!c.q)throw new Error("Cal is not defined. This shouldn't happen");c.fingerprint="40fa383ec";c.__css=A;document.head.appendChild(document.createElement("style")).innerHTML=z;function g(...s){console.log(...s)}function u(s,t){function r(o,i){return typeof i=="string"?typeof o==i:o instanceof i}function e(o){return typeof o>"u"}if(t.required&&e(s))throw new Error("Argument is required");for(const[o,i]of Object.entries(t.props)){if(i.required&&e(s[o]))throw new Error(`"${o}" is required`);let n=!0;if(i.type&&!e(s[o])&&(i.type instanceof Array?i.type.forEach(l=>{n=n||r(s[o],l)}):n=r(s[o],i.type)),!n)throw new Error(`"${o}" is of wrong type.Expected type "${i.type}"`)}}class h{constructor(t,r){this.iframeDoQueue=[],this.__config={origin:L},this.namespace=t,this.actionManager=new k(t),h.actionsManagers=h.actionsManagers||{},h.actionsManagers[t]=this.actionManager,this.processQueue(r),this.actionManager.on("__dimensionChanged",e=>{const{data:o}=e.detail,i=this.iframe;if(!i)return;let n="px";o.__unit&&(n=o.__unit),o.iframeHeight&&(i.style.height=o.iframeHeight+n),this.modalBox&&(i.style.maxHeight=window.innerHeight-100+"px")}),this.actionManager.on("__iframeReady",()=>{this.iframeReady=!0,this.doInIframe({method:"parentKnowsIframeReady",arg:void 0}),this.iframeDoQueue.forEach(({method:e,arg:o})=>{this.doInIframe({method:e,arg:o})})}),this.actionManager.on("__routeChanged",()=>{const{top:e,height:o}=this.inlineEl.getBoundingClientRect();e<0&&Math.abs(e/o)>=.25&&this.inlineEl.scrollIntoView({behavior:"smooth"})}),this.actionManager.on("linkReady",()=>{var e,o;(e=this.modalBox)==null||e.setAttribute("state","loaded"),(o=this.inlineEl)==null||o.setAttribute("loading","done")}),this.actionManager.on("linkFailed",e=>{var i,n,l,d;this.iframe&&((i=this.inlineEl)==null||i.setAttribute("data-error-code",e.detail.data.code),(n=this.modalBox)==null||n.setAttribute("data-error-code",e.detail.data.code),(l=this.inlineEl)==null||l.setAttribute("loading","failed"),(d=this.modalBox)==null||d.setAttribute("state","failed"))})}static getQueryObject(t){return t=t||{},{...t,guest:t.guests??void 0}}processInstruction(t){if(t=[].slice.call(t,0),t[0]instanceof Array){t.forEach(o=>{this.processInstruction(o)});return}const[r,...e]=t;this[r]||g(`Instruction ${r} not FOUND`);try{this[r](...e)}catch(o){g("Instruction couldn't be executed",o)}return t}processQueue(t){t.forEach(r=>{this.processInstruction(r)}),t.splice(0),t.push=r=>{this.processInstruction(r)}}createIframe({calLink:t,queryObject:r={}}){const e=this.iframe=document.createElement("iframe");e.className="cal-embed",e.name="cal-embed";const o=this.getConfig(),{iframeAttrs:i,...n}=r;i&&typeof i!="string"&&!(i instanceof Array)&&e.setAttribute("id",i.id);const l=new URLSearchParams;for(const[a,p]of Object.entries(n))p!==void 0&&(p instanceof Array?p.forEach(x=>l.append(a,x)):l.set(a,p));const d=new URL(`${o.origin}/${t}`);d.pathname.endsWith("embed")||(d.pathname=`${d.pathname}/embed`),d.searchParams.set("embed",this.namespace),o.debug&&d.searchParams.set("debug",""+o.debug),o.uiDebug&&(e.style.border="1px solid green");for(const[a,p]of l)d.searchParams.append(a,p);return e.src=d.toString(),e}init(t,r={}){typeof t!="string"&&(r=t||{});const{origin:e,...o}=r;e&&(this.__config.origin=e),this.__config={...this.__config,...o}}getConfig(){return this.__config}inline({calLink:t,elementOrSelector:r,config:e}){u(arguments[0],{required:!0,props:{calLink:{required:!0,type:"string"},elementOrSelector:{required:!0,type:["string",HTMLElement]},config:{required:!1,type:Object}}}),e=e||{},e.__autoScroll=!!e.__autoScroll,e.embedType="inline";const o=this.createIframe({calLink:t,queryObject:h.getQueryObject(e)});o.style.height="100%",o.style.width="100%";const i=r instanceof HTMLElement?r:document.querySelector(r);if(!i)throw new Error("Element not found");i.classList.add("cal-inline-container");const n=document.createElement("template");n.innerHTML='<cal-inline style="max-height:inherit;height:inherit;min-height:inherit;display:flex;position:relative;flex-wrap:wrap;width:100%"></cal-inline><style>.cal-inline-container::-webkit-scrollbar{display:none}.cal-inline-container{scrollbar-width:none}</style>',this.inlineEl=n.content.children[0],this.inlineEl.__CalAutoScroll=e.__autoScroll,this.inlineEl.appendChild(o),i.appendChild(n.content)}floatingButton({calLink:t,buttonText:r="Book my Cal",hideButtonIcon:e=!1,attributes:o,buttonPosition:i="bottom-right",buttonColor:n="rgb(0, 0, 0)",buttonTextColor:l="rgb(255, 255, 255)"}){let d=null;o!=null&&o.id&&(d=document.getElementById(o.id));let a;d?a=d:(a=document.createElement("cal-floating-button"),a.dataset.calLink=t,a.dataset.calNamespace=this.namespace,o!=null&&o.id&&(a.id=o.id),document.body.appendChild(a)),r&&a.setAttribute("data-button-text",r),a.setAttribute("data-hide-button-icon",""+e),a.setAttribute("data-button-position",""+i),a.setAttribute("data-button-color",""+n),a.setAttribute("data-button-text-color",""+l)}modal({calLink:t,config:r={},uid:e}){const o=document.querySelector(`cal-modal-box[uid="${e}"]`);if(o){o.setAttribute("state","started");return}r.embedType="modal";const i=this.createIframe({calLink:t,queryObject:h.getQueryObject(r)});i.style.borderRadius="8px",i.style.height="100%",i.style.width="100%";const n=document.createElement("template");n.innerHTML=`<cal-modal-box uid="${e}"></cal-modal-box>`,this.modalBox=n.content.children[0],this.modalBox.appendChild(i),this.actionManager.on("__closeIframe",()=>{this.modalBox.setAttribute("state","closed")}),document.body.appendChild(n.content)}on({action:t,callback:r}){u(arguments[0],{required:!0,props:{action:{required:!0,type:"string"},callback:{required:!0,type:Function}}}),this.actionManager.on(t,r)}off({action:t,callback:r}){this.actionManager.off(t,r)}preload({calLink:t}){u(arguments[0],{required:!0,props:{calLink:{type:"string",required:!0}}});const r=document.body.appendChild(document.createElement("iframe")),e=this.getConfig(),o=new URL(`${e.origin}/${t}`);o.searchParams.set("prerender","true"),r.src=o.toString(),r.style.width="0",r.style.height="0",r.style.display="none"}ui(t){u(t,{required:!0,props:{theme:{required:!1,type:"string"},styles:{required:!1,type:Object}}}),this.doInIframe({method:"ui",arg:t})}doInIframe({method:t,arg:r}){if(!this.iframeReady){this.iframeDoQueue.push({method:t,arg:r});return}this.iframe.contentWindow.postMessage({originator:"CAL",method:t,arg:r},"*")}}c.instance=new h("",c.q);for(const[s,t]of Object.entries(c.ns))t.instance=new h(s,t.q);window.addEventListener("message",s=>{const t=s.data,r=t.fullType,e=k.parseAction(r);if(!e)return;const o=h.actionsManagers[e.ns];if(c.__logQueue=c.__logQueue||[],c.__logQueue.push({...e,data:t.data}),!o)throw new Error("Unhandled Action"+e);o.fire(e.type,t.data)});document.addEventListener("click",s=>{const t=s.target;if(!(t instanceof HTMLElement))return;const r=t.dataset.calLink;if(!r)return;const e=t.uniqueId=t.uniqueId||Date.now(),o=t.dataset.calNamespace,i=t.dataset.calConfig||"";let n;try{n=JSON.parse(i)}catch{n={}}let l=c;if(o&&(l=c.ns[o]),!l)throw new Error(`Namespace ${o} isn't defined`);l("modal",{calLink:r,config:n,uid:e})});
</div>`;class m extends HTMLElement{static get observedAttributes(){return["state"]}assertHasShadowRoot(){if(!this.shadowRoot)throw new Error("No shadow root")}show(t){this.assertHasShadowRoot(),this.shadowRoot.host.style.visibility=t?"visible":"hidden",t||(document.body.style.overflow=m.htmlOverflow)}close(){this.show(!1)}getLoaderElement(){this.assertHasShadowRoot();const t=this.shadowRoot.querySelector(".loader");if(!t)throw new Error("No loader element");return t}getErrorElement(){this.assertHasShadowRoot();const t=this.shadowRoot.querySelector("#error");if(!t)throw new Error("No error element");return t}attributeChangedCallback(t,r,e){if(t==="state"){if(e=="loaded")this.getLoaderElement().style.display="none";else if(e==="started")this.show(!0);else if(e=="closed")this.show(!1);else if(e==="failed"){this.getLoaderElement().style.display="none",this.getErrorElement().style.display="inline-block";const o=y(this.dataset.errorCode);this.getErrorElement().innerText=o}}}connectedCallback(){this.assertHasShadowRoot();const t=this.shadowRoot.querySelector(".close");document.addEventListener("keydown",r=>{r.key==="Escape"&&this.close()},{once:!0}),this.shadowRoot.host.addEventListener("click",()=>{this.close()}),t&&(t.onclick=()=>{this.close()})}constructor(){super();const t=`<style>${window.Cal.__css}</style><style>${A}</style>${R}`;this.attachShadow({mode:"open"}),m.htmlOverflow=document.body.style.overflow,document.body.style.overflow="hidden",this.assertHasShadowRoot(),this.shadowRoot.innerHTML=t}}const L=`.cal-embed{border:0px;min-height:300px;margin:0 auto;width:100%}
`;function g(n,t){const r=new window.CustomEvent(n,{detail:t});window.dispatchEvent(r)}class k{static parseAction(t){if(!t)return null;const[r,e,o]=t.split(":");return r!=="CAL"?null:{ns:e,type:o}}getFullActionName(t){return this.namespace?`CAL:${this.namespace}:${t}`:`CAL::${t}`}fire(t,r){const e=this.getFullActionName(t),o={type:t,namespace:this.namespace,fullType:e,data:r};g(e,o),g(this.getFullActionName("*"),o)}on(t,r){const e=this.getFullActionName(t);window.addEventListener(e,r)}off(t,r){const e=this.getFullActionName(t);window.removeEventListener(e,r)}constructor(t){t=t||"",this.namespace=t}}const M=`*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:var(--font-inter),ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:Roboto Mono,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}[type=text],[type=email],[type=url],[type=password],[type=number],[type=date],[type=datetime-local],[type=month],[type=search],[type=tel],[type=time],[type=week],[multiple],textarea,select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;border-color:#6b7280;border-width:1px;border-radius:0;padding:.5rem .75rem;font-size:1rem;line-height:1.5rem;--tw-shadow: 0 0 #0000}[type=text]:focus,[type=email]:focus,[type=url]:focus,[type=password]:focus,[type=number]:focus,[type=date]:focus,[type=datetime-local]:focus,[type=month]:focus,[type=search]:focus,[type=tel]:focus,[type=time]:focus,[type=week]:focus,[multiple]:focus,textarea:focus,select:focus{outline:2px solid transparent;outline-offset:2px;--tw-ring-inset: var(--tw-empty, );--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: #2563eb;--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-color:#2563eb}input::-moz-placeholder,textarea::-moz-placeholder{color:#6b7280;opacity:1}input::placeholder,textarea::placeholder{color:#6b7280;opacity:1}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-date-and-time-value{min-height:1.5em}::-webkit-datetime-edit,::-webkit-datetime-edit-year-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-meridiem-field{padding-top:0;padding-bottom:0}select{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236B7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");background-position:right .5rem center;background-repeat:no-repeat;background-size:1.5em 1.5em;padding-right:2.5rem;-webkit-print-color-adjust:exact;print-color-adjust:exact}[multiple]{background-image:initial;background-position:initial;background-repeat:unset;background-size:initial;padding-right:.75rem;-webkit-print-color-adjust:unset;print-color-adjust:unset}[type=checkbox],[type=radio]{-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0;-webkit-print-color-adjust:exact;print-color-adjust:exact;display:inline-block;vertical-align:middle;background-origin:border-box;-webkit-user-select:none;-moz-user-select:none;user-select:none;flex-shrink:0;height:1rem;width:1rem;color:#2563eb;background-color:#fff;border-color:#6b7280;border-width:1px;--tw-shadow: 0 0 #0000}[type=checkbox]{border-radius:0}[type=radio]{border-radius:100%}[type=checkbox]:focus,[type=radio]:focus{outline:2px solid transparent;outline-offset:2px;--tw-ring-inset: var(--tw-empty, );--tw-ring-offset-width: 2px;--tw-ring-offset-color: #fff;--tw-ring-color: #2563eb;--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}[type=checkbox]:checked,[type=radio]:checked{border-color:transparent;background-color:currentColor;background-size:100% 100%;background-position:center;background-repeat:no-repeat}[type=checkbox]:checked{background-image:url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e")}[type=radio]:checked{background-image:url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8' cy='8' r='3'/%3e%3c/svg%3e")}[type=checkbox]:checked:hover,[type=checkbox]:checked:focus,[type=radio]:checked:hover,[type=radio]:checked:focus{border-color:transparent;background-color:currentColor}[type=checkbox]:indeterminate{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3e%3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 8h8'/%3e%3c/svg%3e");border-color:transparent;background-color:currentColor;background-size:100% 100%;background-position:center;background-repeat:no-repeat}[type=checkbox]:indeterminate:hover,[type=checkbox]:indeterminate:focus{border-color:transparent;background-color:currentColor}[type=file]{background:unset;border-color:inherit;border-width:0;border-radius:0;padding:0;font-size:unset;line-height:inherit}[type=file]:focus{outline:1px solid ButtonText;outline:1px auto -webkit-focus-ring-color}*{scrollbar-color:initial;scrollbar-width:initial}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.visible{visibility:visible}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.bottom-4{bottom:1rem}.right-4{right:1rem}.left-4{left:1rem}.left-1\\/2{left:50%}.z-\\[10000000000\\]{z-index:10000000000}.z-\\[999999999999\\]{z-index:999999999999}.mr-3{margin-right:.75rem}.flex{display:flex}.hidden{display:none}.h-16{height:4rem}.h-7{height:1.75rem}.w-7{width:1.75rem}.w-full{width:100%}.origin-center{transform-origin:center}.-translate-x-1\\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-pointer{cursor:pointer}.items-center{align-items:center}.justify-center{justify-content:center}.rounded-full{border-radius:9999px}.bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity))}.bg-brand{background-color:var(--cal-brand-color, black)}.py-4{padding-top:1rem;padding-bottom:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.text-base{font-size:1rem;line-height:1.5rem}.font-semibold{font-weight:600}.leading-5{line-height:1.25rem}.text-inverted{color:var(--cal-text-inverted, white)}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.outline-none{outline:2px solid transparent;outline-offset:2px}.drop-shadow-md{--tw-drop-shadow: drop-shadow(0 4px 3px rgb(0 0 0 / .07)) drop-shadow(0 2px 2px rgb(0 0 0 / .06));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}@font-face{font-family:Cal Sans;src:url(https://cal.com/cal.ttf)}h1,h2,h3,h4,h5,h6{font-family:Cal Sans;font-weight:400;letter-spacing:normal}html,body,:host{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\\:ring-gray-600:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(75 85 99 / var(--tw-ring-opacity))}.focus\\:ring-opacity-50:focus{--tw-ring-opacity: .5}.active\\:scale-95:active{--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@media (min-width: 768px){.md\\:bottom-6{bottom:1.5rem}.md\\:right-10{right:2.5rem}.md\\:left-10{left:2.5rem}}
`,j="https://app.cal.com";customElements.define("cal-modal-box",m);customElements.define("cal-floating-button",w);customElements.define("cal-inline",z);const p=window.Cal;if(!p||!p.q)throw new Error("Cal is not defined. This shouldn't happen");p.fingerprint="e3fb7182c";p.__css=M;document.head.appendChild(document.createElement("style")).innerHTML=L;function b(...n){console.log(...n)}function f(n,t){function r(o,i){return typeof i=="string"?typeof o==i:o instanceof i}function e(o){return typeof o>"u"}if(t.required&&e(n))throw new Error("Argument is required");for(const[o,i]of Object.entries(t.props||{})){if(i.required&&e(n[o]))throw new Error(`"${o}" is required`);let a=!0;if(i.type&&!e(n[o])&&(i.type instanceof Array?i.type.forEach(s=>{a=a||r(n[o],s)}):a=r(n[o],i.type)),!a)throw new Error(`"${o}" is of wrong type.Expected type "${i.type}"`)}}class u{constructor(t,r){this.iframeDoQueue=[],this.__config={calOrigin:j},this.api=new q(this),this.namespace=t,this.actionManager=new k(t),u.actionsManagers=u.actionsManagers||{},u.actionsManagers[t]=this.actionManager,this.processQueue(r),this.actionManager.on("__dimensionChanged",e=>{const{data:o}=e.detail,i=this.iframe;if(!i)return;const a="px";o.iframeHeight&&(i.style.height=o.iframeHeight+a),this.modalBox&&(i.style.maxHeight=window.innerHeight-100+"px")}),this.actionManager.on("__iframeReady",()=>{this.iframeReady=!0,this.doInIframe({method:"parentKnowsIframeReady"}),this.iframeDoQueue.forEach(e=>{this.doInIframe(e)})}),this.actionManager.on("__routeChanged",()=>{const{top:e,height:o}=this.inlineEl.getBoundingClientRect();e<0&&Math.abs(e/o)>=.25&&this.inlineEl.scrollIntoView({behavior:"smooth"})}),this.actionManager.on("linkReady",()=>{var e,o;(e=this.modalBox)==null||e.setAttribute("state","loaded"),(o=this.inlineEl)==null||o.setAttribute("loading","done")}),this.actionManager.on("linkFailed",e=>{var i,a,s,l;this.iframe&&((i=this.inlineEl)==null||i.setAttribute("data-error-code",e.detail.data.code),(a=this.modalBox)==null||a.setAttribute("data-error-code",e.detail.data.code),(s=this.inlineEl)==null||s.setAttribute("loading","failed"),(l=this.modalBox)==null||l.setAttribute("state","failed"))})}static getQueryObject(t){return t=t||{},{...t,guest:t.guests??void 0}}processInstruction(t){const r=[].slice.call(t);if(typeof r[0]!="string"){r.forEach(i=>{this.processInstruction(i)});return}const[e,...o]=r;this.api[e]||b(`Instruction ${e} not FOUND`);try{this.api[e](...o)}catch(i){b("Instruction couldn't be executed",i)}return r}processQueue(t){t.forEach(r=>{this.processInstruction(r)}),t.splice(0),t.push=r=>{this.processInstruction(r)}}createIframe({calLink:t,queryObject:r={},calOrigin:e}){const o=this.iframe=document.createElement("iframe");o.className="cal-embed",o.name="cal-embed";const i=this.getConfig(),{iframeAttrs:a,...s}=r;a&&a.id&&o.setAttribute("id",a.id);const l=new URLSearchParams;for(const[c,h]of Object.entries(s))h!==void 0&&(h instanceof Array?h.forEach(x=>l.append(c,x)):l.set(c,h));const d=new URL(`${e||i.calOrigin}/${t}`);d.pathname.endsWith("embed")||(d.pathname=`${d.pathname}/embed`),d.searchParams.set("embed",this.namespace),i.debug&&d.searchParams.set("debug",""+i.debug),i.uiDebug&&(o.style.border="1px solid green");for(const[c,h]of l)d.searchParams.append(c,h);return o.src=d.toString(),o}getConfig(){return this.__config}doInIframe(t){if(!this.iframeReady){this.iframeDoQueue.push(t);return}if(!this.iframe)throw new Error("iframe doesn't exist. `createIframe` must be called before `doInIframe`");this.iframe.contentWindow&&this.iframe.contentWindow.postMessage({originator:"CAL",method:t.method,arg:t.arg},"*")}}class q{constructor(t){this.cal=t}init(t,r={}){typeof t!="string"&&(r=t||{});const{calOrigin:e,origin:o,...i}=r;this.cal.__config.calOrigin=e||o||this.cal.__config.calOrigin,this.cal.__config={...this.cal.__config,...i}}inline({calLink:t,elementOrSelector:r,config:e}){if(f(arguments[0],{required:!0,props:{calLink:{required:!0,type:"string"},elementOrSelector:{required:!0,type:["string",HTMLElement]},config:{required:!1,type:Object}}}),e=e||{},typeof e.iframeAttrs=="string"||e.iframeAttrs instanceof Array)throw new Error("iframeAttrs should be an object");e.embedType="inline";const o=this.cal.createIframe({calLink:t,queryObject:u.getQueryObject(e)});o.style.height="100%",o.style.width="100%";const i=r instanceof HTMLElement?r:document.querySelector(r);if(!i)throw new Error("Element not found");i.classList.add("cal-inline-container");const a=document.createElement("template");a.innerHTML='<cal-inline style="max-height:inherit;height:inherit;min-height:inherit;display:flex;position:relative;flex-wrap:wrap;width:100%"></cal-inline><style>.cal-inline-container::-webkit-scrollbar{display:none}.cal-inline-container{scrollbar-width:none}</style>',this.cal.inlineEl=a.content.children[0],this.cal.inlineEl.appendChild(o),i.appendChild(a.content)}floatingButton({calLink:t,buttonText:r="Book my Cal",hideButtonIcon:e=!1,attributes:o,buttonPosition:i="bottom-right",buttonColor:a="rgb(0, 0, 0)",buttonTextColor:s="rgb(255, 255, 255)",calOrigin:l}){let d=null;o!=null&&o.id&&(d=document.getElementById(o.id));let c;d?c=d:(c=document.createElement("cal-floating-button"),c.dataset.calLink=t,c.dataset.calNamespace=this.cal.namespace,c.dataset.calOrigin=l??"",o!=null&&o.id&&(c.id=o.id),document.body.appendChild(c));const h=c.dataset;h.buttonText=r,h.hideButtonIcon=""+e,h.buttonPosition=""+i,h.buttonColor=""+a,h.buttonTextColor=""+s}modal({calLink:t,calOrigin:r,config:e={},uid:o}){o=o||0;const i=document.querySelector(`cal-modal-box[uid="${o}"]`);if(i){i.setAttribute("state","started");return}if(typeof e.iframeAttrs=="string"||e.iframeAttrs instanceof Array)throw new Error("iframeAttrs should be an object");e.embedType="modal";const a=this.cal.createIframe({calLink:t,calOrigin:r,queryObject:u.getQueryObject(e)});a.style.borderRadius="8px",a.style.height="100%",a.style.width="100%";const s=document.createElement("template");s.innerHTML=`<cal-modal-box uid="${o}"></cal-modal-box>`,this.cal.modalBox=s.content.children[0],this.cal.modalBox.appendChild(a),this.cal.actionManager.on("__closeIframe",()=>{this.cal.modalBox.setAttribute("state","closed")}),document.body.appendChild(s.content)}on({action:t,callback:r}){f(arguments[0],{required:!0,props:{action:{required:!0,type:"string"},callback:{required:!0,type:Function}}}),this.cal.actionManager.on(t,r)}off({action:t,callback:r}){this.cal.actionManager.off(t,r)}preload({calLink:t}){f(arguments[0],{required:!0,props:{calLink:{type:"string",required:!0}}});const r=document.body.appendChild(document.createElement("iframe")),e=this.cal.getConfig(),o=new URL(`${e.calOrigin}/${t}`);o.searchParams.set("prerender","true"),r.src=o.toString(),r.style.width="0",r.style.height="0",r.style.display="none"}ui(t){f(t,{required:!0,props:{theme:{required:!1,type:"string"},styles:{required:!1,type:Object}}}),this.cal.doInIframe({method:"ui",arg:t})}}p.instance=new u("",p.q);for(const[n,t]of Object.entries(p.ns))t.instance=new u(n,t.q);window.addEventListener("message",n=>{const t=n.data,r=t.fullType,e=k.parseAction(r);if(!e)return;const o=u.actionsManagers[e.ns];if(p.__logQueue=p.__logQueue||[],p.__logQueue.push({...e,data:t.data}),!o)throw new Error("Unhandled Action"+e);o.fire(e.type,t.data)});document.addEventListener("click",n=>{const t=n.target;if(!(t instanceof HTMLElement))return;const r=t.dataset.calLink;if(!r)return;const e=t.dataset.uniqueId=t.dataset.uniqueId||String(Date.now()),o=t.dataset.calNamespace,i=t.dataset.calConfig||"",a=t.dataset.calOrigin||"";let s;try{s=JSON.parse(i)}catch{s={}}let l=p;if(o&&(l=p.ns[o]),!l)throw new Error(`Namespace ${o} isn't defined`);l("modal",{calLink:r,config:s,uid:e,calOrigin:a})});
}()

@@ -1,1 +0,1 @@

(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const t of document.querySelectorAll('link[rel="modulepreload"]'))o(t);new MutationObserver(t=>{for(const e of t)if(e.type==="childList")for(const r of e.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&o(r)}).observe(document,{childList:!0,subtree:!0});function s(t){const e={};return t.integrity&&(e.integrity=t.integrity),t.referrerPolicy&&(e.referrerPolicy=t.referrerPolicy),t.crossOrigin==="use-credentials"?e.credentials="include":t.crossOrigin==="anonymous"?e.credentials="omit":e.credentials="same-origin",e}function o(t){if(t.ep)return;t.ep=!0;const e=s(t);fetch(t.href,e)}})();const m="https://app.cal.com",p="http://localhost:3000/embed/embed.js";window.fingerprint="40fa383ec";(function(i,n,s){const o=function(e,r){e.q.push(r)},t=i.document;i.Cal=i.Cal||function(){const e=i.Cal,r=arguments;if(e.loaded||(e.ns={},e.q=e.q||[],t.head.appendChild(t.createElement("script")).src=n,e.loaded=!0),r[0]===s){const c=function(){o(c,arguments)},u=r[1];c.q=c.q||[],typeof u=="string"?(e.ns[u]=c)&&o(c,r):o(e,r);return}o(e,r)}})(window,p,"init");const a=window;a.Cal("init",{origin:m});const f=new URL(document.URL).searchParams,l=f.get("embedType"),d=f.get("calLink");if(l==="inline")a.Cal("inline",{elementOrSelector:"#my-embed",calLink:d});else if(l==="floating-popup")a.Cal("floatingButton",{calLink:d,attributes:{id:"my-floating-button"}});else if(l==="element-click"){const i=document.createElement("button");i.setAttribute("data-cal-link",d),i.innerHTML="I am a button that exists on your website",document.body.appendChild(i)}a.addEventListener("message",i=>{const n=i.data;if(n.mode!=="cal:preview")return;const s=window.Cal;if(!s)throw new Error("Cal is not defined yet");if(n.type=="instruction"&&s(n.instruction.name,n.instruction.arg),n.type=="inlineEmbedDimensionUpdate"){const o=document.querySelector("#my-embed");o&&(o.style.width=n.data.width,o.style.height=n.data.height)}});
(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const t of document.querySelectorAll('link[rel="modulepreload"]'))o(t);new MutationObserver(t=>{for(const e of t)if(e.type==="childList")for(const r of e.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&o(r)}).observe(document,{childList:!0,subtree:!0});function s(t){const e={};return t.integrity&&(e.integrity=t.integrity),t.referrerPolicy&&(e.referrerPolicy=t.referrerPolicy),t.crossOrigin==="use-credentials"?e.credentials="include":t.crossOrigin==="anonymous"?e.credentials="omit":e.credentials="same-origin",e}function o(t){if(t.ep)return;t.ep=!0;const e=s(t);fetch(t.href,e)}})();const m="https://app.cal.com",p="http://localhost:3000/embed/embed.js";(function(i,n,s){const o=function(e,r){e.q.push(r)},t=i.document;i.Cal=i.Cal||function(){const e=i.Cal,r=arguments;if(e.loaded||(e.ns={},e.q=e.q||[],t.head.appendChild(t.createElement("script")).src=n,e.loaded=!0),r[0]===s){const c=function(){o(c,arguments)},u=r[1];c.q=c.q||[],typeof u=="string"?(e.ns[u]=c)&&o(c,r):o(e,r);return}o(e,r)}})(window,p,"init");const a=window;a.Cal.fingerprint="e3fb7182c";a.Cal("init",{origin:m});const f=new URL(document.URL).searchParams,d=f.get("embedType"),l=f.get("calLink");if(!l)throw new Error('Missing "calLink" query parameter');if(d==="inline")a.Cal("inline",{elementOrSelector:"#my-embed",calLink:l});else if(d==="floating-popup")a.Cal("floatingButton",{calLink:l,attributes:{id:"my-floating-button"}});else if(d==="element-click"){const i=document.createElement("button");i.setAttribute("data-cal-link",l),i.innerHTML="I am a button that exists on your website",document.body.appendChild(i)}a.addEventListener("message",i=>{const n=i.data;if(n.mode!=="cal:preview")return;const s=window.Cal;if(!s)throw new Error("Cal is not defined yet");if(n.type=="instruction"&&s(n.instruction.name,n.instruction.arg),n.type=="inlineEmbedDimensionUpdate"){const o=document.querySelector("#my-embed");o&&(o.style.width=n.data.width,o.style.height=n.data.height)}});
import type { CSSProperties } from "react";
export interface UiConfig {
export type UiConfig = {
hideEventTypeDetails?: boolean;
theme?: "dark" | "light" | "auto";
styles?: EmbedStyles;
}
styles?: EmbedStyles & EmbedNonStylesConfig;
};
type SetStyles = React.Dispatch<React.SetStateAction<EmbedStyles>>;
type setNonStylesConfig = React.Dispatch<React.SetStateAction<EmbedNonStylesConfig>>;
declare const embedStore: {
styles: EmbedStyles | undefined;
nonStyles: EmbedNonStylesConfig | undefined;
namespace: string | null;
embedType: string | null | undefined;
reactStylesStateSetters: Record<keyof EmbedStyles, SetStyles>;
reactNonStylesStateSetters: Record<keyof EmbedNonStylesConfig, setNonStylesConfig>;
parentInformedAboutContentHeight: boolean;
windowLoadEventFired: boolean;
setTheme: ((arg0: string) => void) | undefined;
theme: "dark" | "light" | "auto" | undefined;
uiConfig: Omit<UiConfig, "theme" | "styles"> | undefined;
setUiConfig: ((arg0: UiConfig) => void) | undefined;
};
declare global {
interface Window {
CalEmbed: {
__logQueue?: any[];
embedStore: any;
__logQueue?: unknown[];
embedStore: typeof embedStore;
};

@@ -29,26 +45,12 @@ CalComPageStatus: string;

/** Default would be center */
align: "left";
align?: "left";
branding?: {
brandColor?: string;
lightColor?: string;
lighterColor?: string;
lightestColor?: string;
highlightColor?: string;
darkColor?: string;
darkerColor?: string;
medianColor?: string;
};
}
export declare const useEmbedTheme: () => string | null;
export declare const useEmbedUiConfig: () => Omit<UiConfig, "styles" | "theme">;
export declare const useEmbedUiConfig: () => Omit<UiConfig, "theme" | "styles">;
export declare const useEmbedStyles: (elementName: keyof EmbedStyles) => Pick<CSSProperties, "background">;
export declare const useEmbedNonStylesConfig: (elementName: keyof EmbedNonStylesConfig) => "left" | {
brandColor?: string | undefined;
lightColor?: string | undefined;
lighterColor?: string | undefined;
lightestColor?: string | undefined;
highlightColor?: string | undefined;
darkColor?: string | undefined;
darkerColor?: string | undefined;
medianColor?: string | undefined;
};

@@ -58,17 +60,14 @@ export declare const useIsBackgroundTransparent: () => boolean;

brandColor?: string | undefined;
lightColor?: string | undefined;
lighterColor?: string | undefined;
lightestColor?: string | undefined;
highlightColor?: string | undefined;
darkColor?: string | undefined;
darkerColor?: string | undefined;
medianColor?: string | undefined;
};
export declare const useIsEmbed: (embedSsr?: boolean) => boolean | undefined;
export declare const useEmbedType: () => string | null | undefined;
export declare const methods: {
declare const methods: {
ui: (uiConfig: UiConfig) => void;
parentKnowsIframeReady: () => void;
parentKnowsIframeReady: (_unused: unknown) => void;
};
export type InterfaceWithParent = {
[key in keyof typeof methods]: (firstAndOnlyArg: Parameters<(typeof methods)[key]>[number]) => void;
};
export declare const interfaceWithParent: InterfaceWithParent;
export {};
//# sourceMappingURL=embed-iframe.d.ts.map

@@ -1,12 +0,37 @@

import type { methods, UiConfig } from "./embed-iframe";
import type { InterfaceWithParent, interfaceWithParent, UiConfig } from "./embed-iframe";
import type { EventData, EventDataMap } from "./sdk-action-manager";
import { SdkActionManager } from "./sdk-action-manager";
type Rest<T extends any[]> = T extends [any, ...infer U] ? U : never;
export type Message = {
originator: string;
method: keyof InterfaceWithParent;
arg: InterfaceWithParent[keyof InterfaceWithParent];
};
declare module "*.css";
type Namespace = string;
type Config = {
origin: string;
calOrigin: string;
debug?: boolean;
uiDebug?: boolean;
};
export type Instruction = [method: string, argument: any] | [method: string, argument: any][];
type InitArgConfig = Partial<Config> & {
origin?: string;
};
type DoInIframeArg = {
[K in keyof typeof interfaceWithParent]: {
method: K;
arg?: Parameters<(typeof interfaceWithParent)[K]>[0];
};
}[keyof typeof interfaceWithParent];
type SingleInstructionMap = {
[K in keyof CalApi]: CalApi[K] extends (...args: never[]) => void ? [K, ...Parameters<CalApi[K]>] : never;
};
type SingleInstruction = SingleInstructionMap[keyof SingleInstructionMap];
export type Instruction = SingleInstruction | SingleInstruction[];
export type InstructionQueue = Instruction[];
type PrefillAndIframeAttrsConfig = Record<string, string | string[] | Record<string, string>> & {
iframeAttrs?: Record<string, string> & {
id?: string;
};
};
export declare class Cal {

@@ -20,18 +45,29 @@ iframe?: HTMLIFrameElement;

iframeReady: boolean;
iframeDoQueue: {
method: keyof typeof methods;
arg: any;
}[];
iframeDoQueue: DoInIframeArg[];
api: CalApi;
static actionsManagers: Record<Namespace, SdkActionManager>;
static getQueryObject(config: Record<string, string>): {
guest: string;
static getQueryObject(config: PrefillAndIframeAttrsConfig): Record<string, string | string[] | Record<string, string>> & {
iframeAttrs?: (Record<string, string> & {
id?: string | undefined;
}) | undefined;
} & {
guest?: string | string[] | undefined;
};
processInstruction(instruction: Instruction): [method: string, argument: any][] | undefined;
processQueue(queue: InstructionQueue): void;
createIframe({ calLink, queryObject, }: {
processInstruction(instructionAsArgs: IArguments | Instruction): SingleInstruction[] | undefined;
processQueue(queue: IArguments[]): void;
createIframe({ calLink, queryObject, calOrigin, }: {
calLink: string;
queryObject?: Record<string, string | string[] | Record<string, string>>;
queryObject?: PrefillAndIframeAttrsConfig & {
guest?: string | string[];
};
calOrigin?: string;
}): HTMLIFrameElement;
init(namespaceOrConfig?: string | Config, config?: Config): void;
getConfig(): Config;
doInIframe(doInIframeArg: DoInIframeArg): void;
constructor(namespace: string, q: IArguments[]);
}
declare class CalApi {
cal: Cal;
constructor(cal: Cal);
init(namespaceOrConfig?: string | InitArgConfig, config?: InitArgConfig): void;
/**

@@ -43,25 +79,27 @@ * It is an instruction that adds embed iframe inline as last child of the element

elementOrSelector: string | HTMLElement;
config: Record<string, string>;
config?: PrefillAndIframeAttrsConfig;
}): void;
floatingButton({ calLink, buttonText, hideButtonIcon, attributes, buttonPosition, buttonColor, buttonTextColor, }: {
floatingButton({ calLink, buttonText, hideButtonIcon, attributes, buttonPosition, buttonColor, buttonTextColor, calOrigin, }: {
calLink: string;
buttonText?: string;
attributes?: Record<string, string>;
attributes?: Record<"id", string> & Record<string | "id", string>;
hideButtonIcon?: boolean;
buttonPosition?: "bottom-left" | "bottom-right";
buttonColor: string;
buttonTextColor: string;
buttonColor?: string;
buttonTextColor?: string;
calOrigin?: string;
}): void;
modal({ calLink, config, uid }: {
modal({ calLink, calOrigin, config, uid, }: {
calLink: string;
config?: Record<string, string>;
uid: number;
config?: PrefillAndIframeAttrsConfig;
uid?: string | number;
calOrigin?: string;
}): void;
on({ action, callback, }: {
action: Parameters<SdkActionManager["on"]>[0];
callback: Parameters<SdkActionManager["on"]>[1];
on<T extends keyof EventDataMap>({ action, callback, }: {
action: T;
callback: (arg0: CustomEvent<EventData<T>>) => void;
}): void;
off({ action, callback, }: {
action: Parameters<SdkActionManager["on"]>[0];
callback: Parameters<SdkActionManager["on"]>[1];
off({ action, callback }: {
action: never;
callback: never;
}): void;

@@ -72,33 +110,28 @@ preload({ calLink }: {

ui(uiConfig: UiConfig): void;
doInIframe({ method, arg, }: {
method: "ui";
arg: Parameters<(typeof methods)["ui"]>[0];
} | {
method: "parentKnowsIframeReady";
arg: undefined;
}): void;
constructor(namespace: string, q: InstructionQueue);
}
export interface GlobalCal {
(methodName: string, arg?: any): void;
export interface GlobalCalWithoutNs {
<T extends keyof SingleInstructionMap>(methodName: T, ...arg: Rest<SingleInstructionMap[T]>): void;
/** Marks that the embed.js is loaded. Avoids re-downloading it. */
loaded?: boolean;
/** Maintains a queue till the time embed.js isn't loaded */
q?: InstructionQueue;
q: IArguments[];
/** If user registers multiple namespaces, those are available here */
ns?: Record<string, GlobalCal>;
instance?: Cal;
__css?: string;
fingerprint?: string;
__logQueue?: any[];
__logQueue?: unknown[];
}
type GlobalCalWithNs = GlobalCalWithoutNs & {
ns: Record<string, GlobalCalWithoutNs>;
};
export type GlobalCal = GlobalCalWithNs;
declare global {
interface Window {
Cal?: GlobalCal;
Cal: GlobalCal;
}
}
export interface CalWindow extends Window {
Cal?: GlobalCal;
Cal: GlobalCal;
}
export {};
//# sourceMappingURL=embed.d.ts.map

@@ -0,7 +1,26 @@

type ModalTargetDatasetProps = {
calLink: string;
calNamespace: string;
calOrigin: string;
};
type CamelCase<T extends string> = T extends `${infer U}${infer V}` ? `${Uppercase<U>}${V}` : T;
type HyphenatedStringToCamelCase<S extends string> = S extends `${infer T}-${infer U}` ? `${T}${HyphenatedStringToCamelCase<CamelCase<U>>}` : CamelCase<S>;
type HyphenatedDataStringToCamelCase<S extends string> = S extends `data-${infer U}` ? HyphenatedStringToCamelCase<U> : S;
declare const dataAttributes: readonly ["data-button-text", "data-hide-button-icon", "data-button-position", "data-button-color", "data-button-text-color"];
type DataAttributes = (typeof dataAttributes)[number];
type DataAttributesCamelCase = HyphenatedDataStringToCamelCase<DataAttributes>;
export type FloatingButtonDataset = {
[key in DataAttributesCamelCase]: string;
};
export declare class FloatingButton extends HTMLElement {
static updatedClassString(position: string, classString: string): string;
static get observedAttributes(): string[];
attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
dataset: DOMStringMap & FloatingButtonDataset & ModalTargetDatasetProps;
static get observedAttributes(): readonly ["data-button-text", "data-hide-button-icon", "data-button-position", "data-button-color", "data-button-text-color"];
attributeChangedCallback(name: DataAttributes, oldValue: string, newValue: string): void;
assertHasShadowRoot(): asserts this is HTMLElement & {
shadowRoot: ShadowRoot;
};
constructor();
}
export {};
//# sourceMappingURL=FloatingButton.d.ts.map
export declare class Inline extends HTMLElement {
static get observedAttributes(): string[];
assertHasShadowRoot(): asserts this is HTMLElement & {
shadowRoot: ShadowRoot;
};
attributeChangedCallback(name: string, oldValue: string, newValue: string): void;

@@ -4,0 +7,0 @@ constructor();

@@ -1,3 +0,3 @@

declare const html = "<div id=\"wrapper\" style=\"top:50%; left:50%\" class=\"absolute z-highest\">\n<div style=\"transform:translate(-50%,-50%)\" class=\"loader border-brand dark:border-darkmodebrand\">\n\t<span class=\"loader-inner bg-brand dark:bg-darkmodebrand\"></span>\n</div>\n<div id=\"error\" style=\"transform:translate(-50%,-50%)\" class=\"hidden\">\nSomething went wrong.\n</div>\n</div>\n<slot></slot>";
declare const html = "<div id=\"wrapper\" style=\"top:50%; left:50%;transform:translate(-50%,-50%)\" class=\"absolute z-highest\">\n<div class=\"loader border-brand-default dark:border-darkmodebrand\">\n\t<span class=\"loader-inner bg-brand dark:bg-darkmodebrand\"></span>\n</div>\n<div id=\"error\" style=\"transform:translate(-50%,-50%)\" class=\"hidden\">\nSomething went wrong.\n</div>\n</div>\n<slot></slot>";
export default html;
//# sourceMappingURL=inlineHtml.d.ts.map

@@ -1,3 +0,3 @@

declare const html = "<style>\n.my-backdrop {\n position:fixed;\n width:100%;\n height:100%;\n top:0;\n left:0;\n z-index:99999999;\n display:block;\n background-color:rgb(5,5,5, 0.8)\n}\n\n.modal-box {\n margin:0 auto;\n margin-top:20px;\n margin-bottom:20px;\n position:absolute;\n width:100%;\n top:50%;\n left:50%;\n transform: translateY(-50%) translateX(-50%);\n overflow: auto;\n}\n\n.header {\n position: relative;\n float:right;\n top: 10px;\n}\n.close {\n font-size: 30px;\n left: -20px;\n position: relative;\n color:white;\n cursor: pointer;\n}\n/*Modal background is black only, so hardcode white */\n.loader {\n --cal-brand-color:white;\n}\n</style>\n<div class=\"my-backdrop\">\n<div class=\"header\">\n <span class=\"close\">&times;</span>\n</div>\n<div class=\"modal-box\">\n <div class=\"body\">\n <div id=\"wrapper\" class=\"z-[999999999999] absolute flex w-full items-center\">\n <div class=\"loader modal-loader border-brand dark:border-darkmodebrand\">\n <span class=\"loader-inner bg-brand dark:bg-darkmodebrand\"></span>\n </div>\n </div>\n <div id=\"error\" class=\"hidden left-1/2 -translate-x-1/2 relative text-white\"></div>\n <slot></slot>\n </div>\n</div>\n</div>";
declare const html = "<style>\n.my-backdrop {\n position:fixed;\n width:100%;\n height:100%;\n top:0;\n left:0;\n z-index:99999999;\n display:block;\n background-color:rgb(5,5,5, 0.8)\n}\n\n.modal-box {\n margin:0 auto;\n margin-top:20px;\n margin-bottom:20px;\n position:absolute;\n width:100%;\n top:50%;\n left:50%;\n transform: translateY(-50%) translateX(-50%);\n overflow: auto;\n}\n\n.header {\n position: relative;\n float:right;\n top: 10px;\n}\n.close {\n font-size: 30px;\n left: -20px;\n position: relative;\n color:white;\n cursor: pointer;\n}\n/*Modal background is black only, so hardcode white */\n.loader {\n --cal-brand-color:white;\n}\n</style>\n<div class=\"my-backdrop\">\n<div class=\"header\">\n <span class=\"close\">&times;</span>\n</div>\n<div class=\"modal-box\">\n <div class=\"body\">\n <div id=\"wrapper\" class=\"z-[999999999999] absolute flex w-full items-center\">\n <div class=\"loader modal-loader border-brand-default dark:border-darkmodebrand\">\n <span class=\"loader-inner bg-brand dark:bg-darkmodebrand\"></span>\n </div>\n </div>\n <div id=\"error\" class=\"hidden left-1/2 -translate-x-1/2 relative text-inverted\"></div>\n <slot></slot>\n </div>\n</div>\n</div>";
export default html;
//# sourceMappingURL=ModalBoxHtml.d.ts.map
type Namespace = string;
type CustomEventDetail = Record<string, any>;
export type EventDataMap = {
eventTypeSelected: {
eventType: any;
};
linkFailed: {
code: string;
msg: string;
data: {
url: string;
};
};
linkReady: Record<string, never>;
bookingSuccessful: {
booking: unknown;
eventType: unknown;
date: string;
duration: number | undefined;
organizer: {
name: string;
email: string;
timeZone: string;
};
confirmed: boolean;
};
"*": Record<string, unknown>;
__routeChanged: Record<string, never>;
__windowLoadComplete: Record<string, never>;
__closeIframe: Record<string, never>;
__iframeReady: Record<string, never>;
__dimensionChanged: {
iframeHeight: number;
iframeWidth: number;
isFirstTime: boolean;
};
};
export type EventData<T extends keyof EventDataMap> = {
[K in T]: {
type: string;
namespace: string;
fullType: string;
data: EventDataMap[K];
};
}[T];
export declare class SdkActionManager {

@@ -10,5 +52,5 @@ namespace: Namespace;

getFullActionName(name: string): string;
fire(name: string, data: CustomEventDetail): void;
on(name: string, callback: (arg0: CustomEvent<CustomEventDetail>) => void): void;
off(name: string, callback: (arg0: CustomEvent<CustomEventDetail>) => void): void;
fire<T extends keyof EventDataMap>(name: T, data: EventDataMap[T]): void;
on<T extends keyof EventDataMap>(name: T, callback: (arg0: CustomEvent<EventData<T>>) => void): void;
off<T extends keyof EventDataMap>(name: T, callback: (arg0: CustomEvent<EventData<T>>) => void): void;
constructor(ns: string | null);

@@ -15,0 +57,0 @@ }

{
"name": "@calcom/embed-core",
"version": "1.1.3",
"version": "1.1.4",
"description": "This is the vanilla JS core script that embeds Cal Link",

@@ -26,2 +26,3 @@ "main": "./dist/embed/embed.js",

"type-check": "tsc --pretty --noEmit",
"type-check:ci": "tsc-absolute --pretty --noEmit",
"lint": "eslint --ext .ts,.js src",

@@ -32,4 +33,5 @@ "lint:fix": "eslint --ext .ts,.js src --fix",

"embed-tests-update-snapshots:ci": "yarn embed-tests-quick --update-snapshots",
"prepare": "NEXT_PUBLIC_WEBAPP_URL='https://app.cal.com' yarn build",
"publish-prod:patch": "yarn publish --access public --patch",
"prepublishOnly": "NEXT_PUBLIC_WEBAPP_URL='https://app.cal.com' yarn build",
"prepublish": "yarn prepublishOnly",
"publish-prod:patch": "yarn npm publish --access public",
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf ../../../apps/web/public/embed"

@@ -48,4 +50,4 @@ },

"devDependencies": {
"@playwright/test": "^1.31.2",
"autoprefixer": "^10.4.12",
"eslint": "^8.34.0",
"npm-run-all": "^4.1.5",

@@ -57,2 +59,2 @@ "postcss": "^8.4.18",

}
}
}

@@ -127,3 +127,3 @@ # embed-core

- Inline mode doesn't cause any scroll in iframe by default. It looks like it is part of the website.
- docs.cal.com
- cal.com/docs

@@ -130,0 +130,0 @@ - A complete document on how to use embed

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc