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O,GAAG,SAAS,KAAK,MAAM,SAAS,QAAQ,EAAU","file":"/npm/@importbase/importer@1.0.1/dist/packages/index.1.0.1.umd.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@importbase/importer@1.0.1/dist/packages/index.1.0.1.umd.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","(function(n,s){typeof exports==\"object\"&&typeof module<\"u\"?module.exports=s():typeof define==\"function\"&&define.amd?define(s):(n=typeof globalThis<\"u\"?globalThis:n||self,n.ImportBase=s())})(this,function(){\"use strict\";var b=Object.defineProperty;var y=(n,s,r)=>s in n?b(n,s,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[s]=r;var i=(n,s,r)=>y(n,typeof s!=\"symbol\"?s+\"\":s,r);const n={noMode:\"Please define the mode property. Available values are demo, development, and production. Refer to https://docs.importbase.app/get-started/embed-importer for more details.\",noTemplateKey:\"Please provide a template key. You can get your template key via the ImportBase dashboard at https://importbase.app/app.\",launchFailed:\"ImportBase importer has failed to initialize\",iFrameEmpty:\"iFrame contentWindow is null and the iframe has never been closed\",invalidRowLimit:\"row_limit property, if provided, must be a number\"},s=\"__importbase__parent\",r=\"__importbase__iframe\",h=\"__importbase__loader\",c=\"https://importbase.app/embed\",f=`\n#${s} {\n    position: fixed;\n    top: 0;\n    left: 0;\n    width: 100%;\n    height: 100%;\n    background-color: rgba(0,0,0, 0.3);\n    display: flex;\n    justify-content: center;\n    align-items: center;\n    z-index: 100;\n}\n\n#${h} {\n    position: absolute;\n    top: 0;\n    left: 0;\n    width: 100%;\n    height: 100%;\n    z-index: -1;\n    display: flex;\n    justify-content: center;\n    align-items: center;\n    border-radius: 0;\n}\n\n#${r} {\n    width: 100%;\n    height: 100%;\n    border-width: 0px;\n    z-index: 100;\n    border-radius: 0;\n}\n\n@media (min-width: 767px) {\n    #${h} {\n        top: 5%;\n        left: 5%;\n        width: 90%;\n        height: 90%;\n        border-radius: 1rem;\n    }\n\n    #${r} {\n        width: 90%;\n        height: 90%;\n        border-radius: 1rem;\n    }\n}\n`;class p{constructor(e){i(this,\"_iframe\");i(this,\"_parent\");i(this,\"_launched\",!1);i(this,\"_completed\",!1);i(this,\"_error\",!1);i(this,\"_closed\",!1);i(this,\"_mode\",\"development\");i(this,\"_loadingElement\");i(this,\"_iframeHasLoaded\",!1);i(this,\"_maxLaunchRetries\",5);i(this,\"_extraData\");i(this,\"_clientId\");i(this,\"_iFrameClassName\");i(this,\"_columns\");i(this,\"_templateKey\");i(this,\"_onSuccess\");i(this,\"_onError\");i(this,\"_onClose\");i(this,\"_theme\");i(this,\"_rowLimit\");if(e.mode===void 0)throw new Error(n.noMode);if(e.mode!==\"demo\"&&!e.templateKey)throw new Error(n.noTemplateKey);if(e.rowLimit&&typeof e.rowLimit!=\"number\"&&!/^\\d+$/.test(e.rowLimit))throw new Error(n.invalidRowLimit);if(this._mode=e.mode,this._iFrameClassName=e.iFrameClassName,this._onSuccess=e.onSuccess,this._onError=e.onError,this._onClose=e.onClose,this._theme=e.theme,this._extraData=e.extraData,this._rowLimit=e.rowLimit,e.mode!==\"demo\"){if(this._clientId=e==null?void 0:e.clientId,this._templateKey=e==null?void 0:e.templateKey,e.extraData!==void 0&&this._extraData!==void 0){if(typeof e.extraData!=\"object\")throw new Error(\"the extraData property must be an object\");for(let o in e.extraData){const d=e.extraData[o];if(d==null||typeof d==\"number\"&&isNaN(d))this._extraData[o]=null;else if(![\"string\",\"number\",\"boolean\"].includes(typeof d))throw new Error(\"values in extraData must be a string, number, or boolean\")}}const t=(e==null?void 0:e.columns)||[],a=t.map(o=>o.label),l=t.map(o=>o.internal_ref);if(a.length!==[...new Set(a)].length)throw new Error(\"Column labels must be unique\");if(l.length!==[...new Set(l)].length)throw new Error(\"Column labels must be unique\");t.forEach(o=>{var _;if(!o.type||!o.internal_ref)throw new Error(\"Each column must have a type and a key.\");if(typeof o.internal_ref!=\"string\")throw new TypeError(`Column references must be strings. Column reference ${o.internal_ref} is not a string.`);if(![\"text\",\"email\",\"url\",\"phone\",\"us_phone\",\"us_postcode\",\"picklist\",\"number\",\"percentage\",\"boolean\",\"date\",\"datetime\"].includes(o.type))throw new Error(`Column type ${o.type} is not recognized. Please refer to https://docs.importbase.app/configuring-columns.`);if(o.type!==\"picklist\")return;if(!((_=o.meta.options)!=null&&_.length))throw new Error(\"Picklist columns must contain a non-empty `options` array in the `meta` object. Please refer to https://docs.importbase.com/configuring-columns.\");const d=o.meta.options.map(m=>(m==null?void 0:m.label)||\"\"),u=o.meta.options.map(m=>(m==null?void 0:m.value)||\"\");if(d.length!==[...new Set(d)].length)throw new Error(\"Picklist option labels must be unique\");if(u.length!==[...new Set(u)].length)throw new Error(\"Picklist option labels must be unique\")}),this._columns=t}}launch(){if(!document.getElementById(\"__importbase__styles\")){const l=document.createElement(\"style\");l.id=\"__importbase__styles\",l.innerHTML=f,document.head.appendChild(l)}const t=document.createElement(\"div\");t.id=s;const a=document.createElement(\"div\");a.id=h,this._loadingElement=a,t.appendChild(a),document.body.append(t),this._parent=t,this._setupIframe(t),this._setupListeners(),this._sendLaunchMessageWithRetry()}close(){this._removeSelf()}_setupListeners(){this._iframe!==void 0&&(this._iframe.onload=()=>{this._iframeHasLoaded=!0}),window.addEventListener(\"message\",e=>{switch(e.data.type){case\"launched\":this._launched=!0;break;case\"completed\":this._completed=!0,this._launched=!1,this._onSuccess(e.data),this._removeSelf();break;case\"closed\":this._launched=!1,this._removeSelf(),this._onClose();break;case\"error\":this._error=!0,this._onError(e.data.message);break;default:return}})}_removeSelf(){this._parent&&this._parent.remove(),this._closed=!0,this._iframe=void 0,this._iframeHasLoaded=!1,document.body.style.overflow=\"auto\"}_sendLaunchMessageWithRetry(e=0){const t={client_id:this._clientId,template_key:this._templateKey,columns:this._columns,mode:this._mode,theme:this._theme,extra_data:this._extraData,row_limit:this._rowLimit};if(!this._launched){if(e>=this._maxLaunchRetries){this._mode===\"development\"&&console.warn(n.launchFailed);return}if(this._iframe!==void 0&&this._iframeHasLoaded){const a=this._iframe.contentWindow;if(a!==null)try{a.postMessage(t,c)}catch(l){this._mode===\"development\"&&console.log(l)}else if(!this._closed)throw new Error(n.iFrameEmpty)}setTimeout(()=>this._sendLaunchMessageWithRetry(e+1),1e3)}}_setupIframe(e){let t=document.getElementById(r);t||(t=document.createElement(\"iframe\"),t.id=r),t.src=this._mode===\"demo\"?c+\"?demo=true\":c,t.className=this._iFrameClassName||\"\",t.style.visibility=\"hidden\",this._iframe=t,t.addEventListener(\"load\",function(){setTimeout(()=>{t.style.visibility=\"visible\"},300)}),e?e.appendChild(t):document.body.append(t),document.body.style.overflow=\"hidden\"}}return p});\n"]}