@picked/client 0.0.47-next.1 → 0.0.47-next.2

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/cjs/index.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("effector"),S=require("@withease/factories"),I=require("../experience-instance-BsXG5XJ4.cjs"),x=require("../logger-BsmHUUw1.cjs"),w=require("../storage-Be5xWNPC.cjs"),H=require("../api-DzSCgBQ2.cjs"),K=require("../id-BKIWbSTy.cjs"),G=require("../object-BbFTsGh3.cjs"),k=require("../supports-YvpQZxbh.cjs"),U=g.createDomain("experience"),W=S.createFactory(({client:t,experience:e})=>{const r=U.store(e),s=g.createApi(r,{merge(u,m){return{...u,...m.experience}}}),i=r.map(u=>({name:u.name,decisionLogic:u.condition??u.decide,targetSelectors:u.targets,initializeOpenLogic:e.initializeOpen})),d=t.components.listStore.map(u=>u.find(m=>m.name===`experience:${e.id}`)||u.find(m=>m.name==="experience"),{skipVoid:!1}),a=r.map(u=>({steps:u.steps,nodes:u.nodes,edges:u.edges,conditionals:u.conditionals})),n=r.map(u=>u.fields),p=e.actions??[];return{id:e.id,configStore:i,treeStore:a,fieldsStore:n,componentStore:d,actions:p,merge:s.merge}});function J(t){return S.invoke(W,t)}const Y=S.createFactory(({client:t})=>{const e=U.store({}),r=g.createApi(e,{register(u,m){return{...u,[m.id]:m}}});function s(u){const m=e.getState()[u.id];if(m){m.merge({experience:u,strategy:"override"});return}const b=J({client:t,experience:u});r.register(b)}const i=e.map(u=>Object.values(u));function d(u){return e.map(m=>m[u],{skipVoid:!1})}const a=d,n=g.attach({source:e,effect:async(u,{id:m,options:b})=>{const y=u[m];if(!y){x.logger("warn",`Experience with id '${m}' not found.`);return}if(b?.bypassCondition){C(t,y,b);return}await L(t,y)&&C(t,y,b)}}),p=g.attach({source:t.experienceInstances.listStore,effect:(u,{id:m,options:b})=>{const y=u.filter(o=>o.experienceId===m);if(y.length>0)for(const o of y)o.open();else n({id:m,options:{...b,initialiseOpen:!0}})}});return{register:s,get:d,getById:a,launch:n,open:p,listStore:i}});function Q(t){return S.invoke(Y,t)}const X=(t,e)=>{e.register(t)},C=(t,e,r)=>{const{targetSelectors:s}=e.configStore.getState(),i=I.getTargetElements(s,e.id);i.forEach(({elements:a})=>a.forEach(n=>I.tagTargetElement(n,e.id))),I.createAppHosts(i,e.id).forEach(a=>{r?t.experienceInstances.spawn(e,a,r):t.experienceInstances.spawn(e,a)})},z=async t=>{await Promise.all(t.experiences.listStore.getState().map(async e=>{await L(t,e)&&C(t,e)}))},L=async(t,e)=>{if(!t.session?.isUser)return!1;const{decisionLogic:r,targetSelectors:s}=e.configStore.getState();return I.getTargetElements(s,e.id).length<1||s.length===0?!1:r===void 0?!0:I.isRulesLogic(r)?await I.evaluateRuleLogic(t,r)===!0:!0},Z=(t,e,r)=>{const s=e.name,i=e.setup(t);if(i){const d=r[s]??{};r[s]=Object.freeze({...d,...i})}},ee=g.createDomain("component"),te=S.createFactory(({client:t,component:e,name:r})=>{const s=t.frameworks.getByName(e.frameworkName);return{name:r,component:e,frameworkStore:s}});function re(t){return S.invoke(te,t)}const se=S.createFactory(({client:t})=>{const e=ee.store({}),r=g.createApi(e,{register(a,n){return{...a,[n.name]:n}}});function s(a,n){e.getState()[a]&&x.logger("warn",`Component '${a}' already registered. Registering again will override the previous registration.`);const u=re({client:t,name:a,component:n});r.register(u)}const i=e.map(a=>Object.values(a));function d(a){return e.map(n=>n[a],{skipVoid:!1})}return{register:s,getByName:d,listStore:i}});function ne(t){return S.invoke(se,t)}const D=(t,e,r)=>{r.register(t,e)},ie=g.createDomain("framework"),oe=S.createFactory(({client:t})=>{const e=ie.store({}),r=g.createApi(e,{register(a,n){return{...a,[n.name]:n.framework}}});function s(a,n){e.getState()[a]&&x.logger("warn",`Framework '${a}' already registered. Registering again will override the previous registration.`),r.register({name:a,framework:n})}const i=e.map(a=>Object.values(a));function d(a){return e.map(n=>n[a],{skipVoid:!1})}return{register:s,getByName:d,listStore:i}});function ae(t){return S.invoke(oe,t)}const ce=(t,e)=>{e.register(t.name,t)},ue=6e3,le=w.createStorageKey("last_ping","global"),de=async t=>{try{const e=Date.now(),r=w.localStore.get(le);let s=0;if(r.isSet()&&(s=r.json()??0),s&&e-s<ue)return!0;const i={projectId:t.projectId,path:window.location.pathname},d={},n=document.getElementById("picked_script")?.dataset.verceltoken;n&&(d["x-vercel-protection-bypass"]=n);const u=(await H.post(t.apiUrl,"ping",i,d)).ok;return u&&r.set(e),u}catch(e){return x.logger("error",e),!1}};function V(t){const e=typeof window<"u",r={client:t,responses:t.responses.listStore.getState(),fields:t.fields.listStore.getState(),location:e?window.location:void 0,document:e?window.document:void 0,sessionStorage:e?window.sessionStorage:void 0,localStorage:e?window.localStorage:void 0};return Object.freeze(r)}const pe=g.createDomain("predicate"),fe=S.createFactory(({client:t})=>{const e=pe.store({}),r=g.createApi(e,{register(n,p){return{...n,[p.name]:{name:p.name,predicate:p.predicate}}}});function s(n,p){e.getState()[n]&&x.logger("warn",`Predicate '${n}' already registered. Registering again will override the previous registration.`),r.register(Object.freeze({name:n,predicate:p}))}const i=e.map(n=>Object.values(n));function d(n){return e.map(p=>p[n]?.predicate,{skipVoid:!1})}function a(n){const p=g.createStore(()=>{},{skipVoid:!1}),u=g.createEffect(async()=>{const m=d(n).getState();if(!m)return;const b=V(t);return(...y)=>m({...b,args:y})});return g.sample({source:{responses:t.responses.listStore,fields:t.fields.listStore},target:u}),g.sample({clock:u.doneData,filter:m=>m!==void 0,target:p}),u(),p}return{register:s,getByName:d,listStore:i,getEvokablePredicate:a}});function ge(t){return S.invoke(fe,t)}const me=(t,e,r)=>{r.register(t,e)},B=g.createDomain("feature"),ye=S.createFactory(({client:t})=>{const e=B.store({}),r=B.store([]),s=g.createApi(e,{register(o,c){return{...o,[c.id]:c.feature}}});function i(o,c){e.getState()[o]&&x.logger("warn",`Feature '${o}' already registered. Registering again will override the previous registration.`);const l={id:o,feature:{...c,id:o}};s.register(Object.freeze({id:o,feature:l}))}const d=g.createEffect(async({id:o,key:c,storage:f="local"})=>{const l=w.createStorageKey(`feature:${o}:${c}`,"global"),v=(f==="session"?w.sessionStore:w.localStore).get(l).boolean();return v===null?null:{id:o,key:c,bucket:v,storage:f}}),a=g.createEffect(o=>{if(!o)return null;const c=w.createStorageKey(`feature:${o.id}:${o.key}`,"global");(o.storage==="session"?w.sessionStore:w.localStore).set(c,o.bucket)}),n=new Map,p=g.attach({source:{allFeaturesStore:e,resolvedFeaturesStore:r},effect:async({allFeaturesStore:o,resolvedFeaturesStore:c},{id:f,decide:l,key:h})=>{const v=c.find(P=>P.id===f&&P.key===h);if(v)return v;const E=o[f];if(!E)throw new Error(`Feature with id '${f}' not found`);const A=n.get(`${f}:${h}`);if(A!==void 0){const P=await A;return{id:E.id,bucket:P,key:h,storage:E.feature.storage}}const F=l();n.set(`${f}:${h}`,F);const q=await F;return{id:E.id,bucket:q,key:h,storage:E.feature.storage}}});g.sample({clock:s.register,fn:o=>{const{id:c,feature:f}=o;return{id:c,key:f.feature.key,storage:f.feature.storage}},target:d}),g.sample({source:e,clock:p.doneData,fn:(o,c)=>{const{id:f,bucket:l,storage:h}=c,v=o[f]?.feature.key;return v?{key:v,id:f,bucket:l,storage:h}:null},target:a});const u=g.combine({allFeaturesStore:e,resolvedFeaturesStore:r}).map(({allFeaturesStore:o,resolvedFeaturesStore:c})=>Object.values(o).map(f=>{const l=c.find(h=>h.id===f.id&&h.key===f.feature.key);return l?{id:f.id,name:f.feature.name,key:f.feature.key,getBucket:()=>({id:f.id,bucket:l.bucket}),isResolved:!0}:{id:f.id,name:f.feature.name,key:f.feature.key,getBucket:async()=>await p(f.feature),isResolved:!1}}));g.sample({clock:p.doneData,source:{resolvedFeatures:r},filter:({resolvedFeatures:o},{id:c,key:f})=>!o.some(h=>h.id===c&&h.key===f),fn:(o,c)=>c,target:t.eventBus.prepend(o=>({type:"feature_decide",feature:o}))}),g.sample({clock:[d.doneData,p.doneData],source:r,fn:(o,c)=>!c||o.some(l=>l.id===c.id&&l.key===c.key)?o:[...o,c],target:r});function m(o){return u.map(c=>c.find(f=>f.id===o))}function b(o){return e.map(c=>c[o],{skipVoid:!1})}function y(o){const c=g.createStore(async()=>{},{skipVoid:!1}),f=g.createEffect(async()=>{const l=m(o).getState();if(l)return async()=>(await l.getBucket()).bucket});return g.sample({source:r,filter:l=>l.some(h=>h.id===o),target:f}),g.sample({clock:f.doneData,filter:l=>l!==void 0,target:c}),f(),c}return{register:i,getById:m,getByName:b,listStore:u,getEvokableFeature:y}});function he(t){return S.invoke(ye,t)}const Se=(t,e,r)=>{r.register(t,e)},j=g.createDomain("history");function O(t,e){return{id:K.generateId(`history-entry-${Date.now()}-${Math.random()}}`),node:e,at:Date.now(),experienceId:t}}const ve=S.createFactory(()=>{const t=j.store({entries:[]}),e=j.event(),r=j.event(),s=j.event(),i=j.event();t.on(e,(a,n)=>({entries:[...a.entries,O(n.experienceId,n.node)]})),t.on(r,(a,n)=>({entries:[...a.entries.slice(0,-1),O(n.experienceId,n.node)]})),t.on(i,(a,n)=>n);function d(a,n){const p={lastStepIndex:-1,secondLastStepIndex:-1};for(let u=a.length-1;u>=0;u--){const m=a[u],b=m?.node;if(!(!b||!I.isStepNode(b))&&!(n&&m?.experienceId!==n))if(p.lastStepIndex===-1)p.lastStepIndex=u;else{p.secondLastStepIndex=u;break}}return p}return t.on(s,(a,n)=>{const{secondLastStepIndex:p}=d(a.entries,n.experienceId),u=p!==-1?a.entries.slice(0,p+1):a.entries;return{...a,entries:u}}),{push:e,replace:r,back:s,restore:i,entriesStore:t.map(a=>a.entries)}});function ke(){return S.invoke(ve)}let we=0;const be=t=>{const e=g.createStore([]);return g.sample({clock:t,source:e,fn:(r,s)=>[...r,{id:we++,at:new Date,payload:s}],target:e}),e},Ie=g.createDomain("field"),Fe=S.createFactory(()=>{const t=Ie.store({}),e=g.createApi(t,{register(n,p){return{...n,[p.field.id]:p.field}}});function r(n){e.register({field:n})}function s(n,p){const u=d(n).getState();if(!u)return;const m=Object.assign({},u,{...p});e.register({field:{...m}})}const i=t.map(n=>Object.values(n));function d(n){return t.map(p=>p[n]||null)}function a(n){return t.map(p=>Object.values(p).find(u=>u.name===n)||null)}return{register:r,update:s,getById:d,listStore:i,getByName:a}});function xe(){return S.invoke(Fe)}const Ee=(t,e)=>{e.register(t)},je=g.createDomain("action"),Ae=S.createFactory(()=>{const t=je.store({}),e=g.createApi(t,{register(a,n){return{...a,[n.name]:{name:n.name,action:n.action}}}});function r(a,n){e.register({name:a,action:n})}const s=t.map(a=>Object.values(a));function i(a){return t.map(n=>n[a],{skipVoid:!1})}function d(a){return t.map(n=>{const p=n[a];return p?p.action:void 0},{skipVoid:!1})}return{register:r,getByName:i,listStore:s,getEvokableAction:d}});function Pe(){return S.invoke(Ae)}const Re=(t,e,r)=>{r.register(t,e)};function $(t){return typeof t>"u"||t===null||t===""||Array.isArray(t)&&!t.length}function $e(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||t===null}function M(t){try{return JSON.stringify(t),!0}catch{return!1}}const Ce=g.createDomain("response"),ze=S.createFactory(({client:t})=>{const e=Ce.store({}),r=g.createEvent(),s=g.createEvent(),i=g.createApi(e,{register(y,o){return{...y,[o.fieldId]:o.response}},registerBatch(y,o){return{...y,...o}},clear(y,o){const{[o]:c,...f}=y;return f},clearAll(){return{}}});function d(y,o){if(typeof y=="string"){if(o===void 0)throw new Error("Response is required when registering a single field");i.register({fieldId:y,response:o})}else i.registerBatch(y)}async function a(y){const o=[];return await Promise.allSettled(Object.entries(y).map(async([c,f])=>{let l=f;const h=t.fields.getById(c).getState();if(!h){o.push({fieldId:c,userMessage:`Field '${c}' not found`,systemMessage:`No field with ID '${c}' exists. Available field IDs are: ${Object.keys(t.fields.listStore.getState()).join(",")}.`,value:l});return}if(h.multiple&&(typeof l=="string"||typeof l=="number"||typeof l=="boolean")&&(l=[l]),h.validation&&!G.isEmpty(h.validation)&&!$(l)){const v=await I.evaluateRuleLogic(t,h.validation,{$input:l});if(typeof v=="string"){o.push({fieldId:c,userMessage:v,systemMessage:`Field validation resulted in an error: ${v}.`,value:l});return}if(v===!1){o.push({fieldId:c,userMessage:"This field is invalid",systemMessage:"Field validation resulted in an unspecified error.",value:l});return}}if(h.required&&$(l)){o.push({fieldId:c,userMessage:"This field is required",systemMessage:"Field is required.",value:l});return}if(!h.multiple&&Array.isArray(l)&&l.length>1){o.push({fieldId:c,userMessage:"This field expects a single response",systemMessage:"Field expects a single response.",value:l});return}if(h.type==="object"&&!$(l))if(h.multiple){if(!Array.isArray(l)){o.push({fieldId:c,userMessage:"This field expects multiple values",systemMessage:"Field expects an array of objects.",value:l});return}for(const v of l){if(typeof v!="object"||v===null){o.push({fieldId:c,userMessage:"This field expects object values",systemMessage:"Field expects an array of objects, but received non-object value.",value:l});return}if(!M(v)){o.push({fieldId:c,userMessage:"This field contains non-serializable data",systemMessage:"Field value contains non-JSON-serializable data (functions, circular references, etc.).",value:l});return}}}else{if(Array.isArray(l)){o.push({fieldId:c,userMessage:"This field expects a single value",systemMessage:"Field expects a single object, not an array.",value:l});return}if(typeof l!="object"||l===null){o.push({fieldId:c,userMessage:"This field expects an object value",systemMessage:"Field expects an object value.",value:l});return}if(!M(l)){o.push({fieldId:c,userMessage:"This field contains non-serializable data",systemMessage:"Field value contains non-JSON-serializable data (functions, circular references, etc.).",value:l});return}}if(Array.isArray(h.options)&&h.options.length>0){const v=Array.isArray(l)?l:[l];if(h.type==="object"){const E=h.options.map(F=>JSON.stringify(F.value));v.every(F=>E.includes(JSON.stringify(F)))||o.push({fieldId:c,userMessage:"This field expects a valid option",systemMessage:"Field expects a valid option from the defined choices.",value:l})}else{const E=h.options.map(F=>F.value);v.every(F=>!$e(F)||F===null?!1:E.includes(F))||o.push({fieldId:c,userMessage:"This field expects a valid option",systemMessage:`Field expects a valid option. Valid options are: ${E.join(", ")}`,value:l})}}})),{responsesToCommit:y,validationErrors:o}}async function n(y){const{responsesToCommit:o,validationErrors:c}=await a(y);return c.length?{errors:c}:(i.registerBatch(o),{errors:[]})}const p=e.map(y=>y),u=e.map(y=>Object.keys(y).map(c=>({fieldId:c,value:y[c]})));function m(y){const o=t.fields.getById(y),c=e.map(f=>f[y]||null);return g.combine({f:o,r:c},({f,r:l})=>l||(f?.defaultValue?f.defaultValue:null))}function b(y){const o=t.fields.getByName(y);return g.combine({f:o,s:e},({f:c,s:f})=>{const l=c&&f[c.id]||null;return l||(c?.defaultValue?c.defaultValue:null)})}return g.sample({clock:r,target:i.clearAll}),g.sample({clock:s,target:i.clear}),{register:d,clearAll:r,clear:s,commit:n,getResponsesToCommit:a,listStore:u,getAllStore:p,getByFieldId:m,getByFieldName:b}});function De(t){return S.invoke(ze,t)}const Be=()=>"0.0.47-next.1";function Oe(){if(k.supportsDocument()){const t=[document.currentScript,document.getElementById("picked_script"),document.getElementById("picked"),document.getElementById("cvly"),document.getElementById("cvly-x")];for(const e of t)if(e?.dataset.api)return e.dataset.api}return"https://api.picked.app"}function Me(){if(!k.supportsWindow())return{};const t=new URLSearchParams(window.location.search),e={},r=new Set;for(const[i]of t.entries())i.startsWith("picked-")&&r.add(i);for(const i of r){const d=i.replace("picked-","");e[d]=t.getAll(i)}const s=w.createStorageKey("s");if(r.size>0)w.sessionStore.set(s,e);else{const i=w.sessionStore.get(s);if(i)return i.json()||{}}return e}function Ue(){if(k.supportsCryptoRandomUUID())return crypto.randomUUID();const t=Date.now().toString(36),e=Math.random().toString(36).substring(2,15),r=Math.random().toString(36).substring(2,15),s=Math.random().toString(36).substring(2,15);return`${t}-${e}-${r}-${s}`}const Le=w.createStorageKey("session","global"),Ve=()=>{const t=w.localStore.get(Le);let e;t.isSet()&&(e=t.json());const r=i=>t.set({id:i.id,isUser:i.isUser,identifiers:i.identifiers}),s={id:e?.id??Ue(),isUser:e?.isUser??void 0,identifiers:e?.identifiers??void 0,setIsUser(i){this.isUser=i,r(this)},setIdentifier(i,d){this.identifiers={...this.identifiers,[i]:d},r(this)},removeIdentifier(i){this.identifiers&&(this.identifiers=Object.fromEntries(Object.entries(this.identifiers).filter(([d])=>d!==i)),this.identifiers=Object.keys(this.identifiers).length?this.identifiers:void 0,r(this))}};return r(s),s},Te=()=>k.supportsLocalStorage()?Ve():null;function T(){if(k.supportsWindow())return globalThis.window.pickedConfig}function Ne(){if(!k.supportsWindow())return;const t=T(),e=t?.organizationId,r=t?.projectId;return e&&r?{organizationId:e,projectId:r}:void 0}function _e(){if(!k.supportsDocument())return;const t=document.getElementById("picked_script")||document.querySelector("script#picked")||document.getElementById("cvly");if(!t)return;const e=t.dataset.organizationid||t.getAttribute("organization-id"),r=t.dataset.projectid||t.getAttribute("project-id");return e&&r?{organizationId:e,projectId:r}:void 0}function qe(t){const{organizationId:e,projectId:r}=t;if(e&&r)return{organizationId:e,projectId:r};const s=Ne();if(s)return s;const i=_e();if(i)return i;throw new Error(`organizationId and projectId are required. You can provide them via one of:
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("effector"),S=require("@withease/factories"),I=require("../experience-instance-BsXG5XJ4.cjs"),x=require("../logger-BsmHUUw1.cjs"),w=require("../storage-Be5xWNPC.cjs"),H=require("../api-DzSCgBQ2.cjs"),K=require("../id-BKIWbSTy.cjs"),G=require("../object-BbFTsGh3.cjs"),k=require("../supports-YvpQZxbh.cjs"),U=g.createDomain("experience"),W=S.createFactory(({client:t,experience:e})=>{const r=U.store(e),s=g.createApi(r,{merge(u,m){return{...u,...m.experience}}}),i=r.map(u=>({name:u.name,decisionLogic:u.condition??u.decide,targetSelectors:u.targets,initializeOpenLogic:e.initializeOpen})),d=t.components.listStore.map(u=>u.find(m=>m.name===`experience:${e.id}`)||u.find(m=>m.name==="experience"),{skipVoid:!1}),a=r.map(u=>({steps:u.steps,nodes:u.nodes,edges:u.edges,conditionals:u.conditionals})),n=r.map(u=>u.fields),p=e.actions??[];return{id:e.id,configStore:i,treeStore:a,fieldsStore:n,componentStore:d,actions:p,merge:s.merge}});function J(t){return S.invoke(W,t)}const Y=S.createFactory(({client:t})=>{const e=U.store({}),r=g.createApi(e,{register(u,m){return{...u,[m.id]:m}}});function s(u){const m=e.getState()[u.id];if(m){m.merge({experience:u,strategy:"override"});return}const b=J({client:t,experience:u});r.register(b)}const i=e.map(u=>Object.values(u));function d(u){return e.map(m=>m[u],{skipVoid:!1})}const a=d,n=g.attach({source:e,effect:async(u,{id:m,options:b})=>{const y=u[m];if(!y){x.logger("warn",`Experience with id '${m}' not found.`);return}if(b?.bypassCondition){C(t,y,b);return}await L(t,y)&&C(t,y,b)}}),p=g.attach({source:t.experienceInstances.listStore,effect:(u,{id:m,options:b})=>{const y=u.filter(o=>o.experienceId===m);if(y.length>0)for(const o of y)o.open();else n({id:m,options:{...b,initialiseOpen:!0}})}});return{register:s,get:d,getById:a,launch:n,open:p,listStore:i}});function Q(t){return S.invoke(Y,t)}const X=(t,e)=>{e.register(t)},C=(t,e,r)=>{const{targetSelectors:s}=e.configStore.getState(),i=I.getTargetElements(s,e.id);i.forEach(({elements:a})=>a.forEach(n=>I.tagTargetElement(n,e.id))),I.createAppHosts(i,e.id).forEach(a=>{r?t.experienceInstances.spawn(e,a,r):t.experienceInstances.spawn(e,a)})},z=async t=>{await Promise.all(t.experiences.listStore.getState().map(async e=>{await L(t,e)&&C(t,e)}))},L=async(t,e)=>{if(!t.session?.isUser)return!1;const{decisionLogic:r,targetSelectors:s}=e.configStore.getState();return I.getTargetElements(s,e.id).length<1||s.length===0?!1:r===void 0?!0:I.isRulesLogic(r)?await I.evaluateRuleLogic(t,r)===!0:!0},Z=(t,e,r)=>{const s=e.name,i=e.setup(t);if(i){const d=r[s]??{};r[s]=Object.freeze({...d,...i})}},ee=g.createDomain("component"),te=S.createFactory(({client:t,component:e,name:r})=>{const s=t.frameworks.getByName(e.frameworkName);return{name:r,component:e,frameworkStore:s}});function re(t){return S.invoke(te,t)}const se=S.createFactory(({client:t})=>{const e=ee.store({}),r=g.createApi(e,{register(a,n){return{...a,[n.name]:n}}});function s(a,n){e.getState()[a]&&x.logger("warn",`Component '${a}' already registered. Registering again will override the previous registration.`);const u=re({client:t,name:a,component:n});r.register(u)}const i=e.map(a=>Object.values(a));function d(a){return e.map(n=>n[a],{skipVoid:!1})}return{register:s,getByName:d,listStore:i}});function ne(t){return S.invoke(se,t)}const D=(t,e,r)=>{r.register(t,e)},ie=g.createDomain("framework"),oe=S.createFactory(({client:t})=>{const e=ie.store({}),r=g.createApi(e,{register(a,n){return{...a,[n.name]:n.framework}}});function s(a,n){e.getState()[a]&&x.logger("warn",`Framework '${a}' already registered. Registering again will override the previous registration.`),r.register({name:a,framework:n})}const i=e.map(a=>Object.values(a));function d(a){return e.map(n=>n[a],{skipVoid:!1})}return{register:s,getByName:d,listStore:i}});function ae(t){return S.invoke(oe,t)}const ce=(t,e)=>{e.register(t.name,t)},ue=6e3,le=w.createStorageKey("last_ping","global"),de=async t=>{try{const e=Date.now(),r=w.localStore.get(le);let s=0;if(r.isSet()&&(s=r.json()??0),s&&e-s<ue)return!0;const i={projectId:t.projectId,path:window.location.pathname},d={},n=document.getElementById("picked_script")?.dataset.verceltoken;n&&(d["x-vercel-protection-bypass"]=n);const u=(await H.post(t.apiUrl,"ping",i,d)).ok;return u&&r.set(e),u}catch(e){return x.logger("error",e),!1}};function V(t){const e=typeof window<"u",r={client:t,responses:t.responses.listStore.getState(),fields:t.fields.listStore.getState(),location:e?window.location:void 0,document:e?window.document:void 0,sessionStorage:e?window.sessionStorage:void 0,localStorage:e?window.localStorage:void 0};return Object.freeze(r)}const pe=g.createDomain("predicate"),fe=S.createFactory(({client:t})=>{const e=pe.store({}),r=g.createApi(e,{register(n,p){return{...n,[p.name]:{name:p.name,predicate:p.predicate}}}});function s(n,p){e.getState()[n]&&x.logger("warn",`Predicate '${n}' already registered. Registering again will override the previous registration.`),r.register(Object.freeze({name:n,predicate:p}))}const i=e.map(n=>Object.values(n));function d(n){return e.map(p=>p[n]?.predicate,{skipVoid:!1})}function a(n){const p=g.createStore(()=>{},{skipVoid:!1}),u=g.createEffect(async()=>{const m=d(n).getState();if(!m)return;const b=V(t);return(...y)=>m({...b,args:y})});return g.sample({source:{responses:t.responses.listStore,fields:t.fields.listStore},target:u}),g.sample({clock:u.doneData,filter:m=>m!==void 0,target:p}),u(),p}return{register:s,getByName:d,listStore:i,getEvokablePredicate:a}});function ge(t){return S.invoke(fe,t)}const me=(t,e,r)=>{r.register(t,e)},B=g.createDomain("feature"),ye=S.createFactory(({client:t})=>{const e=B.store({}),r=B.store([]),s=g.createApi(e,{register(o,c){return{...o,[c.id]:c.feature}}});function i(o,c){e.getState()[o]&&x.logger("warn",`Feature '${o}' already registered. Registering again will override the previous registration.`);const l={id:o,feature:{...c,id:o}};s.register(Object.freeze({id:o,feature:l}))}const d=g.createEffect(async({id:o,key:c,storage:f="local"})=>{const l=w.createStorageKey(`feature:${o}:${c}`,"global"),v=(f==="session"?w.sessionStore:w.localStore).get(l).boolean();return v===null?null:{id:o,key:c,bucket:v,storage:f}}),a=g.createEffect(o=>{if(!o)return null;const c=w.createStorageKey(`feature:${o.id}:${o.key}`,"global");(o.storage==="session"?w.sessionStore:w.localStore).set(c,o.bucket)}),n=new Map,p=g.attach({source:{allFeaturesStore:e,resolvedFeaturesStore:r},effect:async({allFeaturesStore:o,resolvedFeaturesStore:c},{id:f,decide:l,key:h})=>{const v=c.find(P=>P.id===f&&P.key===h);if(v)return v;const E=o[f];if(!E)throw new Error(`Feature with id '${f}' not found`);const A=n.get(`${f}:${h}`);if(A!==void 0){const P=await A;return{id:E.id,bucket:P,key:h,storage:E.feature.storage}}const F=l();n.set(`${f}:${h}`,F);const q=await F;return{id:E.id,bucket:q,key:h,storage:E.feature.storage}}});g.sample({clock:s.register,fn:o=>{const{id:c,feature:f}=o;return{id:c,key:f.feature.key,storage:f.feature.storage}},target:d}),g.sample({source:e,clock:p.doneData,fn:(o,c)=>{const{id:f,bucket:l,storage:h}=c,v=o[f]?.feature.key;return v?{key:v,id:f,bucket:l,storage:h}:null},target:a});const u=g.combine({allFeaturesStore:e,resolvedFeaturesStore:r}).map(({allFeaturesStore:o,resolvedFeaturesStore:c})=>Object.values(o).map(f=>{const l=c.find(h=>h.id===f.id&&h.key===f.feature.key);return l?{id:f.id,name:f.feature.name,key:f.feature.key,getBucket:()=>({id:f.id,bucket:l.bucket}),isResolved:!0}:{id:f.id,name:f.feature.name,key:f.feature.key,getBucket:async()=>await p(f.feature),isResolved:!1}}));g.sample({clock:p.doneData,source:{resolvedFeatures:r},filter:({resolvedFeatures:o},{id:c,key:f})=>!o.some(h=>h.id===c&&h.key===f),fn:(o,c)=>c,target:t.eventBus.prepend(o=>({type:"feature_decide",feature:o}))}),g.sample({clock:[d.doneData,p.doneData],source:r,fn:(o,c)=>!c||o.some(l=>l.id===c.id&&l.key===c.key)?o:[...o,c],target:r});function m(o){return u.map(c=>c.find(f=>f.id===o))}function b(o){return e.map(c=>c[o],{skipVoid:!1})}function y(o){const c=g.createStore(async()=>{},{skipVoid:!1}),f=g.createEffect(async()=>{const l=m(o).getState();if(l)return async()=>(await l.getBucket()).bucket});return g.sample({source:r,filter:l=>l.some(h=>h.id===o),target:f}),g.sample({clock:f.doneData,filter:l=>l!==void 0,target:c}),f(),c}return{register:i,getById:m,getByName:b,listStore:u,getEvokableFeature:y}});function he(t){return S.invoke(ye,t)}const Se=(t,e,r)=>{r.register(t,e)},j=g.createDomain("history");function O(t,e){return{id:K.generateId(`history-entry-${Date.now()}-${Math.random()}}`),node:e,at:Date.now(),experienceId:t}}const ve=S.createFactory(()=>{const t=j.store({entries:[]}),e=j.event(),r=j.event(),s=j.event(),i=j.event();t.on(e,(a,n)=>({entries:[...a.entries,O(n.experienceId,n.node)]})),t.on(r,(a,n)=>({entries:[...a.entries.slice(0,-1),O(n.experienceId,n.node)]})),t.on(i,(a,n)=>n);function d(a,n){const p={lastStepIndex:-1,secondLastStepIndex:-1};for(let u=a.length-1;u>=0;u--){const m=a[u],b=m?.node;if(!(!b||!I.isStepNode(b))&&!(n&&m?.experienceId!==n))if(p.lastStepIndex===-1)p.lastStepIndex=u;else{p.secondLastStepIndex=u;break}}return p}return t.on(s,(a,n)=>{const{secondLastStepIndex:p}=d(a.entries,n.experienceId),u=p!==-1?a.entries.slice(0,p+1):a.entries;return{...a,entries:u}}),{push:e,replace:r,back:s,restore:i,entriesStore:t.map(a=>a.entries)}});function ke(){return S.invoke(ve)}let we=0;const be=t=>{const e=g.createStore([]);return g.sample({clock:t,source:e,fn:(r,s)=>[...r,{id:we++,at:new Date,payload:s}],target:e}),e},Ie=g.createDomain("field"),Fe=S.createFactory(()=>{const t=Ie.store({}),e=g.createApi(t,{register(n,p){return{...n,[p.field.id]:p.field}}});function r(n){e.register({field:n})}function s(n,p){const u=d(n).getState();if(!u)return;const m=Object.assign({},u,{...p});e.register({field:{...m}})}const i=t.map(n=>Object.values(n));function d(n){return t.map(p=>p[n]||null)}function a(n){return t.map(p=>Object.values(p).find(u=>u.name===n)||null)}return{register:r,update:s,getById:d,listStore:i,getByName:a}});function xe(){return S.invoke(Fe)}const Ee=(t,e)=>{e.register(t)},je=g.createDomain("action"),Ae=S.createFactory(()=>{const t=je.store({}),e=g.createApi(t,{register(a,n){return{...a,[n.name]:{name:n.name,action:n.action}}}});function r(a,n){e.register({name:a,action:n})}const s=t.map(a=>Object.values(a));function i(a){return t.map(n=>n[a],{skipVoid:!1})}function d(a){return t.map(n=>{const p=n[a];return p?p.action:void 0},{skipVoid:!1})}return{register:r,getByName:i,listStore:s,getEvokableAction:d}});function Pe(){return S.invoke(Ae)}const Re=(t,e,r)=>{r.register(t,e)};function $(t){return typeof t>"u"||t===null||t===""||Array.isArray(t)&&!t.length}function $e(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||t===null}function M(t){try{return JSON.stringify(t),!0}catch{return!1}}const Ce=g.createDomain("response"),ze=S.createFactory(({client:t})=>{const e=Ce.store({}),r=g.createEvent(),s=g.createEvent(),i=g.createApi(e,{register(y,o){return{...y,[o.fieldId]:o.response}},registerBatch(y,o){return{...y,...o}},clear(y,o){const{[o]:c,...f}=y;return f},clearAll(){return{}}});function d(y,o){if(typeof y=="string"){if(o===void 0)throw new Error("Response is required when registering a single field");i.register({fieldId:y,response:o})}else i.registerBatch(y)}async function a(y){const o=[];return await Promise.allSettled(Object.entries(y).map(async([c,f])=>{let l=f;const h=t.fields.getById(c).getState();if(!h){o.push({fieldId:c,userMessage:`Field '${c}' not found`,systemMessage:`No field with ID '${c}' exists. Available field IDs are: ${Object.keys(t.fields.listStore.getState()).join(",")}.`,value:l});return}if(h.multiple&&(typeof l=="string"||typeof l=="number"||typeof l=="boolean")&&(l=[l]),h.validation&&!G.isEmpty(h.validation)&&!$(l)){const v=await I.evaluateRuleLogic(t,h.validation,{$input:l});if(typeof v=="string"){o.push({fieldId:c,userMessage:v,systemMessage:`Field validation resulted in an error: ${v}.`,value:l});return}if(v===!1){o.push({fieldId:c,userMessage:"This field is invalid",systemMessage:"Field validation resulted in an unspecified error.",value:l});return}}if(h.required&&$(l)){o.push({fieldId:c,userMessage:"This field is required",systemMessage:"Field is required.",value:l});return}if(!h.multiple&&Array.isArray(l)&&l.length>1){o.push({fieldId:c,userMessage:"This field expects a single response",systemMessage:"Field expects a single response.",value:l});return}if(h.type==="object"&&!$(l))if(h.multiple){if(!Array.isArray(l)){o.push({fieldId:c,userMessage:"This field expects multiple values",systemMessage:"Field expects an array of objects.",value:l});return}for(const v of l){if(typeof v!="object"||v===null){o.push({fieldId:c,userMessage:"This field expects object values",systemMessage:"Field expects an array of objects, but received non-object value.",value:l});return}if(!M(v)){o.push({fieldId:c,userMessage:"This field contains non-serializable data",systemMessage:"Field value contains non-JSON-serializable data (functions, circular references, etc.).",value:l});return}}}else{if(Array.isArray(l)){o.push({fieldId:c,userMessage:"This field expects a single value",systemMessage:"Field expects a single object, not an array.",value:l});return}if(typeof l!="object"||l===null){o.push({fieldId:c,userMessage:"This field expects an object value",systemMessage:"Field expects an object value.",value:l});return}if(!M(l)){o.push({fieldId:c,userMessage:"This field contains non-serializable data",systemMessage:"Field value contains non-JSON-serializable data (functions, circular references, etc.).",value:l});return}}if(Array.isArray(h.options)&&h.options.length>0){const v=Array.isArray(l)?l:[l];if(h.type==="object"){const E=h.options.map(F=>JSON.stringify(F.value));v.every(F=>E.includes(JSON.stringify(F)))||o.push({fieldId:c,userMessage:"This field expects a valid option",systemMessage:"Field expects a valid option from the defined choices.",value:l})}else{const E=h.options.map(F=>F.value);v.every(F=>!$e(F)||F===null?!1:E.includes(F))||o.push({fieldId:c,userMessage:"This field expects a valid option",systemMessage:`Field expects a valid option. Valid options are: ${E.join(", ")}`,value:l})}}})),{responsesToCommit:y,validationErrors:o}}async function n(y){const{responsesToCommit:o,validationErrors:c}=await a(y);return c.length?{errors:c}:(i.registerBatch(o),{errors:[]})}const p=e.map(y=>y),u=e.map(y=>Object.keys(y).map(c=>({fieldId:c,value:y[c]})));function m(y){const o=t.fields.getById(y),c=e.map(f=>f[y]||null);return g.combine({f:o,r:c},({f,r:l})=>l||(f?.defaultValue?f.defaultValue:null))}function b(y){const o=t.fields.getByName(y);return g.combine({f:o,s:e},({f:c,s:f})=>{const l=c&&f[c.id]||null;return l||(c?.defaultValue?c.defaultValue:null)})}return g.sample({clock:r,target:i.clearAll}),g.sample({clock:s,target:i.clear}),{register:d,clearAll:r,clear:s,commit:n,getResponsesToCommit:a,listStore:u,getAllStore:p,getByFieldId:m,getByFieldName:b}});function De(t){return S.invoke(ze,t)}const Be=()=>"0.0.47-next.2";function Oe(){if(k.supportsDocument()){const t=[document.currentScript,document.getElementById("picked_script"),document.getElementById("picked"),document.getElementById("cvly"),document.getElementById("cvly-x")];for(const e of t)if(e?.dataset.api)return e.dataset.api}return"https://api.picked.app"}function Me(){if(!k.supportsWindow())return{};const t=new URLSearchParams(window.location.search),e={},r=new Set;for(const[i]of t.entries())i.startsWith("picked-")&&r.add(i);for(const i of r){const d=i.replace("picked-","");e[d]=t.getAll(i)}const s=w.createStorageKey("s");if(r.size>0)w.sessionStore.set(s,e);else{const i=w.sessionStore.get(s);if(i)return i.json()||{}}return e}function Ue(){if(k.supportsCryptoRandomUUID())return crypto.randomUUID();const t=Date.now().toString(36),e=Math.random().toString(36).substring(2,15),r=Math.random().toString(36).substring(2,15),s=Math.random().toString(36).substring(2,15);return`${t}-${e}-${r}-${s}`}const Le=w.createStorageKey("session","global"),Ve=()=>{const t=w.localStore.get(Le);let e;t.isSet()&&(e=t.json());const r=i=>t.set({id:i.id,isUser:i.isUser,identifiers:i.identifiers}),s={id:e?.id??Ue(),isUser:e?.isUser??void 0,identifiers:e?.identifiers??void 0,setIsUser(i){this.isUser=i,r(this)},setIdentifier(i,d){this.identifiers={...this.identifiers,[i]:d},r(this)},removeIdentifier(i){this.identifiers&&(this.identifiers=Object.fromEntries(Object.entries(this.identifiers).filter(([d])=>d!==i)),this.identifiers=Object.keys(this.identifiers).length?this.identifiers:void 0,r(this))}};return r(s),s},Te=()=>k.supportsLocalStorage()?Ve():null;function T(){if(k.supportsWindow())return globalThis.window.pickedConfig}function Ne(){if(!k.supportsWindow())return;const t=T(),e=t?.organizationId,r=t?.projectId;return e&&r?{organizationId:e,projectId:r}:void 0}function _e(){if(!k.supportsDocument())return;const t=document.getElementById("picked_script")||document.querySelector("script#picked")||document.getElementById("cvly");if(!t)return;const e=t.dataset.organizationid||t.getAttribute("organization-id"),r=t.dataset.projectid||t.getAttribute("project-id");return e&&r?{organizationId:e,projectId:r}:void 0}function qe(t){const{organizationId:e,projectId:r}=t;if(e&&r)return{organizationId:e,projectId:r};const s=Ne();if(s)return s;const i=_e();if(i)return i;throw new Error(`organizationId and projectId are required. You can provide them via one of:
2
2
  (1) createClient({ organizationId, projectId }) options;
3
3
  (2) window.pickedConfig = { organizationId, projectId };
4
4
  (3) a <script> tag with id 'picked_script', 'picked', or 'cvly' that includes data-organizationid/data-projectid (or organization-id/project-id) attributes.`)}function R(t){return t==null||t===""||Number.isNaN(t)}const He={default:(t,e)=>R(t)?String(e??""):String(t),append:(t,e)=>e&&!R(t)?`${t} ${e}`:t,prepend:(t,e)=>e&&!R(t)?`${e} ${t}`:t,upper:t=>typeof t=="string"?t.toUpperCase():t,lower:t=>typeof t=="string"?t.toLowerCase():t,capitalize:t=>typeof t=="string"?t.charAt(0).toUpperCase()+t.slice(1):t,list:t=>{if(!t||typeof t!="object")return t;const e=new Intl.ListFormat("en",{style:"long",type:"conjunction"});if(Array.isArray(t))return e.format(t.map(String));if(t instanceof Map){const r=Array.from(t.entries()).map(([s,i])=>`${s}: ${i}`);return e.format(r)}return t instanceof Set?e.format(Array.from(t).map(String)):t}};function Ke(t){return typeof t=="object"&&t!==null}function Ge(t,e){let r=e;for(const s of t.split("."))if(Ke(r)&&s in r)r=r[s];else return;return typeof r=="function"?r():r}function We(t,e){const r=t.split("|").map(d=>d.trim()),s=r.shift()??"";let i=Ge(s,e);for(const d of r){const[a,...n]=d.split(":"),p=a?.trim()??"",u=n.join(":").trim().replaceAll(/(?:^['"]|['"]$)/g,""),m=He[p];m&&(i=m(i,u))}return R(i)?"":typeof i=="object"?JSON.stringify(i):String(i)}function Je(t,e){let r="",s=0;for(;s<t.length;)if(t[s]==="{"&&t[s+1]==="{"){s+=2;let i="";for(;s<t.length;){if(t[s]==="}"&&t[s+1]==="}"){s+=2;break}i+=t[s++]}r+=We(i.trim(),e)}else r+=t[s++];return r}class N{static logger=x.logger;options;isReady=!1;project;plugins={};pluginStartHooks=[];eventBus=g.createEvent();events;organizationId;projectId;apiUrl;dashboardUrl;documentationSiteUrl;session;precondition;condition;searchParams=Me();history=ke();components=ne({client:this});experienceInstances=I.createExperienceInstanceIndex({client:this});experiences=Q({client:this});frameworks=ae({client:this});predicates=ge({client:this});features=he({client:this});responses=De({client:this});fields=xe();actions=Pe();constructor(e){x.logger("info","Picked client initializing."),this.events=be(this.eventBus);const{organizationId:r,projectId:s}=qe(e);this.organizationId=r,this.projectId=s,this.options=Object.freeze(e),this.apiUrl=e.apiUrl||Oe(),this.dashboardUrl=e.dashboardUrl??"https://dashboard.picked.app",this.documentationSiteUrl=e.documentationSiteUrl??"https://docs.picked.app",this.session=Te(),this.setupPlugins(),this.setupFeatures(),this.setupPredicates(),this.setupActions(),this.precondition=e.precondition,this.condition=e.condition,this.eventBus({type:"load",version:Be()}),x.logger("info","Picked client initialized.")}start=()=>{de(this),(async()=>{if(!k.supportsDocument())return;await this.runPluginStartHooks();const r=await this.evaluateGate(this.precondition);let s;r&&(s=await this.evaluateGate(this.condition));const i=r&&s===!0;if(typeof s=="boolean"&&this.session){const d=s;this.session.setIsUser(d),this.eventBus({type:"user_decide",value:d})}if(this.eventBus({type:"initialize"}),i&&z(this),await I.domInteractive(),i&&z(this),this.eventBus({type:"ready"}),this.isReady=!0,this.session){const{id:d,isUser:a,identifiers:n}=this.session;this.eventBus({type:"session",id:d,isUser:a,identifiers:n})}})()};registerFramework=e=>{ce(e,this.frameworks)};registerComponent=(e,r)=>{D(e,r,this.components)};registerPlugin=e=>{Z(this,e,this.plugins);const r=this.plugins[e.name];r?.onStart&&this.pluginStartHooks.push(r.onStart)};registerFeature=(e,r)=>{Se(e,r,this.features)};registerPredicate=(e,r)=>{me(e,r,this.predicates)};registerField=e=>{Ee(e,this.fields)};registerAction=(e,r)=>{Re(e,r,this.actions)};registerExperience=e=>{e.component&&D(`experience:${e.id}`,e.component,this.components),X(e,this.experiences)};getStateSnapshot=()=>V(this);launchExperienceById=async(e,r)=>{this.experiences.launch({id:e,options:r})};openExperienceById=async e=>{this.experiences.open({id:e})};async runPluginStartHooks(){for(const e of this.pluginStartHooks)await e()}async evaluateGate(e){return e===void 0?!0:typeof e=="boolean"?e:await I.evaluateRuleLogic(this,e)===!0}setupPlugins(){this.options.plugins?.forEach(e=>{if(Array.isArray(e)){e.forEach(s=>{this.registerPlugin(s)});return}const r=typeof e=="function"?e():e;if(Array.isArray(r)){r.forEach(s=>this.registerPlugin(s));return}this.registerPlugin(r)})}setupFeatures(){const e=this.options.features;e&&(Object.entries(e).forEach(([r,s])=>{const i=typeof s=="function"?s():s;this.registerFeature(r,i)}),this.searchParams.feature&&this.searchParams.feature.forEach(r=>{try{const[s,i]=r.split(":");if(!s||!i)return;let d=i;d==="true"&&(d=!0),d==="false"&&(d=!1),this.registerFeature(s,{key:`${d}`,name:s,decide:()=>d,storage:"session"})}catch{}}))}setupPredicates(){const e=this.options.predicates;e&&Object.entries(e).forEach(([r,s])=>{if(typeof s!="function"){x.logger("warn",`Predicate "${r}" is not a function.`);return}this.registerPredicate(r,s)})}setupActions(){const e=this.options.actions;e&&Object.entries(e).forEach(([r,s])=>{if(typeof s!="function"){x.logger("warn",`Action "${r}" is not a function.`);return}this.registerAction(r,s)})}getPluginConfig=e=>this.plugins[e]??{};renderString=(e,r)=>{const s=this.responses.listStore.getState().reduce((i,d)=>(i[d.fieldId]=d.value,i),{});return Je(e,{...r,responses:s})}}function _(t){return t.options?.some(e=>"condition"in e)??!1}function Ye(t){return t.some(e=>e.condition||_(e))}async function Qe(t,e){return e.length===0||!Ye(e)?e:(await Promise.all(e.map(async s=>{if(!(s.condition?await I.evaluateRuleLogic(t,s.condition):!0))return null;if(!s.options||!_(s))return s;const a=(await Promise.all(s.options.map(async p=>p.condition?await I.evaluateRuleLogic(t,p.condition)?p:null:p))).filter(p=>p!==null);return a.length===s.options.length?s:a.length===0?null:{...s,options:a}}))).filter(s=>s!==null)}function Xe(t){return{$$type:"lazy-component",load:t}}function Ze(t){return typeof t=="object"&&t!==null&&"$$type"in t&&t.$$type==="lazy-component"}const et=t=>{const e=new N(t);return k.bindClient(e),e};exports.evaluateRuleLogic=I.evaluateRuleLogic;exports.isPickedRoot=I.isPickedRoot;exports.createStorageKey=w.createStorageKey;exports.localStore=w.localStore;exports.sessionStore=w.sessionStore;exports.subscribe=w.subscribe;exports.supportsCookies=k.supportsCookies;exports.supportsCryptoRandomUUID=k.supportsCryptoRandomUUID;exports.supportsDocument=k.supportsDocument;exports.supportsHistory=k.supportsHistory;exports.supportsIntersectionObserver=k.supportsIntersectionObserver;exports.supportsLocalStorage=k.supportsLocalStorage;exports.supportsLocation=k.supportsLocation;exports.supportsSessionStorage=k.supportsSessionStorage;exports.supportsShadowRoot=k.supportsShadowRoot;exports.supportsWebComponents=k.supportsWebComponents;exports.supportsWindow=k.supportsWindow;exports.Picked=N;exports.createClient=et;exports.getPickedConfig=T;exports.getStepFields=Qe;exports.isLazyLoader=Ze;exports.lazyComponent=Xe;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("../../../id-BKIWbSTy.cjs"),r={serialize(e){return JSON.stringify(e)},deserialize(e){return JSON.parse(e)}},y=e=>({name:"create-experience",setup:o=>{e.experiences.forEach(s=>{const n=s.serialize(),d=r.deserialize(n);d.component=s.component,o.registerExperience(d),d.fields.forEach(g=>{o.registerField(g)})})}}),z=(e,o)=>({id:f.generateId("node"),position:[0,0],experience:o,type:"action",action:e.action,addNext(n){if(!n.node)throw new Error("Cannot connect to node");const d=h({sourceNode:this,destinationNode:n.node,sourceNodeHandle:null},o);o.edges.push(d)},onSuccess(n){if(!n.node)throw new Error("Cannot connect to node");const d=h({sourceNode:this,destinationNode:n.node,sourceNodeHandle:"true"},o);o.edges.push(d)},onFail(n){if(!n.node)throw new Error("Cannot connect to node");const d=h({sourceNode:this,destinationNode:n.node,sourceNodeHandle:"false"},o);o.edges.push(d)},serialize(){return r.serialize({id:this.id,type:this.type,action:this.action,position:this.position})}}),b=e=>({id:e.id??f.generateId("step"),label:e.label,fields:e.fields??[],addField(o){const s="serialize"in o?o:N(o);return this.fields?.includes(s)||this.fields?.push(s),s}}),v=(e,o)=>{const s={id:e.id??f.generateId("step"),label:e.label,experience:o,fields:e.fields??[],node:null,nextStep(n){return this.experience.addStep(n,this)},nextConditional(n){return this.experience.addConditional(n,this)},addNextExperience(n){return this.experience.addExperience(n,this)},addField(n){return this.experience.addField(n,this)},serialize(){return r.serialize({id:this.id,label:this.label,fieldIds:this.fields.map(n=>n.id)})}};return p({step:s,type:"step"},o),s},x=()=>[0,0],p=(e,o)=>{const s={id:f.generateId("node"),position:x(),experience:o};if(e.type==="step"){const d={...s,type:"step",connectedStep:e.step,serialize(){return r.serialize({id:this.id,type:this.type,stepId:this.connectedStep.id,position:this.position,label:this.connectedStep.label})}};return d.connectedStep.node=d,d}if(e.type==="conditional"){const d={...s,type:"conditional",connectedConditional:e.conditional,serialize(){return r.serialize({id:this.id,type:this.type,conditionalId:this.connectedConditional.id,position:this.position})}};return d.connectedConditional.node=d,d}return e.type==="experience"?{...s,type:"experience",connectedExperience:e.experience,serialize(){return r.serialize({id:this.id,type:this.type,experienceId:this.connectedExperience.id,position:this.position})}}:{...s,type:"origin",serialize(){return r.serialize({id:this.id,type:this.type,position:this.position})}}},h=(e,o)=>({id:f.generateId("edge"),sourceNode:e.sourceNode,sourceNodeHandle:e.sourceNodeHandle,destinationNode:e.destinationNode,experience:o,serialize(){return r.serialize({id:this.id,sourceNodeHandle:this.sourceNodeHandle??void 0,sourceNodeId:this.sourceNode.id,destinationNodeId:this.destinationNode.id})}}),m=(e,o)=>{const s={id:f.generateId("conditional"),condition:e.condition,node:null,experience:o,addTrue(n){if(!this.node||!n.node)throw new Error("todo no node");const d=h({sourceNode:this.node,destinationNode:n.node,sourceNodeHandle:"true"},this.experience);this.experience.edges.push(d)},addFalse(n){if(!this.node||!n.node)throw new Error("todo no node");const d=h({sourceNode:this.node,destinationNode:n.node,sourceNodeHandle:"false"},this.experience);this.experience.edges.push(d)},serialize(){return r.serialize({id:this.id,condition:this.condition})}};return p({conditional:s,type:"conditional"},o),s},N=e=>({id:e.id,name:e.name,type:e.type,label:e.label,placeholder:e.placeholder,description:e.description,helpText:e.helpText,defaultValue:e.defaultValue??null,multiple:e.multiple,validation:e.validation??{},condition:e.condition,required:e.required,options:e.options?.map(s=>({id:"id"in s?s.id:f.generateId("option"),...s}))??null,policies:e.policies,serialize(){const s={id:this.id,name:this.name,label:this.label,placeholder:this.placeholder,required:this.required,description:this.description,helpText:this.helpText,validation:this.validation,condition:this.condition,policies:this.policies},n=typeof this.defaultValue=="string"?this.defaultValue:void 0,d=typeof this.defaultValue=="number"?this.defaultValue:void 0,g=typeof this.defaultValue=="boolean"?this.defaultValue:void 0;switch(this.type){case"text":if(this.multiple){let t;if(Array.isArray(this.defaultValue)){t=[];for(const i of this.defaultValue)typeof i=="string"&&t.push(i);t.length===0&&(t=void 0)}return r.serialize({...s,type:"text",multiple:!0,defaultValue:t,options:this.options?this.options.map(i=>({id:i.id,label:i.label,value:`${i.value}`,condition:i.condition})):null})}return r.serialize({...s,type:"text",multiple:!1,defaultValue:n,options:this.options?this.options.map(t=>({id:t.id,label:t.label,value:`${t.value}`,condition:t.condition})):null});case"number":if(this.multiple){let t;if(Array.isArray(this.defaultValue)){t=[];for(const i of this.defaultValue)typeof i=="number"&&t.push(i);t.length===0&&(t=void 0)}return r.serialize({...s,type:"number",multiple:!0,defaultValue:t,options:this.options?this.options.map(i=>({id:i.id,label:i.label,value:Number(i.value),condition:i.condition})):null})}return r.serialize({...s,type:"number",multiple:!1,defaultValue:d,options:this.options?this.options.map(t=>({id:t.id,label:t.label,value:Number(t.value),condition:t.condition})):null});case"boolean":if(this.multiple){let t;if(Array.isArray(this.defaultValue)){t=[];for(const i of this.defaultValue)typeof i=="boolean"&&t.push(i);t.length===0&&(t=void 0)}return r.serialize({...s,type:"boolean",multiple:!0,defaultValue:t,options:this.options?this.options.map(i=>({id:i.id,label:i.label,value:!!i.value,condition:i.condition})):null})}return r.serialize({...s,type:"boolean",multiple:!1,defaultValue:g,options:this.options?this.options.map(t=>({id:t.id,label:t.label,value:!!t.value,condition:t.condition})):null});case"object":return this.multiple?r.serialize({...s,type:"object",multiple:!0,defaultValue:this.defaultValue,options:this.options?this.options.map(t=>({id:t.id,label:t.label,description:t.description,value:t.value,condition:t.condition})):null}):r.serialize({...s,type:"object",multiple:!1,defaultValue:this.defaultValue,options:this.options?this.options.map(t=>({id:t.id,label:t.label,description:t.description,value:t.value,condition:t.condition})):null});default:throw new Error("Unsupported field type")}}}),E=e=>{const o=[],s=[],n=[],d=[],g=[],t=e.condition??e.decide;return{id:e.id,component:e.component,name:e.name,initializeOpen:e.initializeOpen,condition:t,decide:e.decide,targets:e.targets,steps:o,nodes:s,edges:n,fields:g,conditionals:d,addStep(i,u){let l=u?.node;this.nodes.length===0&&(l=p({type:"origin"},this),this.nodes.push(l));const a="serialize"in i?i:v(i,this);if(l){if(!a.node)throw new Error("todo no node");const c=h({sourceNode:l,destinationNode:a.node,sourceNodeHandle:null},this);this.edges.push(c)}return a.fields.length>0&&a.fields.forEach(c=>{this.fields.includes(c)||this.fields.push(c)}),this.steps.includes(a)||(this.steps.push(a),a.node&&this.nodes.push(a.node)),a},addAction(i,u){let l=u?.node;this.nodes.length===0&&(l=p({type:"origin"},this),this.nodes.push(l));const a="serialize"in i?i:z(i,this);if(l){const c=h({sourceNode:l,destinationNode:a,sourceNodeHandle:null},this);this.edges.push(c)}return this.nodes.push(a),a},addConditional(i,u){let l=u?.node;this.nodes.length===0&&(l=p({type:"origin"},this),this.nodes.push(l));const a="serialize"in i?i:m(i,this);if(l){if(!a.node)throw new Error("todo no node");const c=h({sourceNode:l,destinationNode:a.node,sourceNodeHandle:null},this);this.edges.push(c)}return this.conditionals.includes(a)||(this.conditionals.push(a),a.node&&this.nodes.push(a.node)),a},addExperience(i,u){let l=u?.node;this.nodes.length===0&&(l=p({type:"origin"},this),this.nodes.push(l));const a=p({type:"experience",experience:i},this);if(this.nodes.push(a),l){const c=h({sourceNode:l,destinationNode:a,sourceNodeHandle:null},this);this.edges.push(c)}return i},addField(i,u){const l="serialize"in i?i:N(i);return u&&u.fields.push(l),this.fields.includes(l)||this.fields.push(l),l},serialize(){return r.serialize({id:this.id,component:this.component,name:this.name,initializeOpen:this.initializeOpen,condition:this.condition??this.decide,decide:this.decide,targets:this.targets,steps:this.steps.map(i=>r.deserialize(i.serialize())),nodes:this.nodes.map(i=>r.deserialize(i.serialize())),edges:this.edges.map(i=>r.deserialize(i.serialize())),conditionals:this.conditionals.map(i=>r.deserialize(i.serialize())),fields:this.fields.map(i=>r.deserialize(i.serialize()))})}}};exports.createConditional=m;exports.createEdge=h;exports.createExperience=E;exports.createExperiencePlugin=y;exports.createField=N;exports.createNode=p;exports.createStep=b;exports.serialization=r;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("../../../id-BKIWbSTy.cjs"),r={serialize(e){return JSON.stringify(e)},deserialize(e){return JSON.parse(e)}},y=e=>({name:"create-experience",setup:o=>{e.experiences.forEach(s=>{const n=s.serialize(),d=r.deserialize(n);d.component=s.component,o.registerExperience(d),d.fields.forEach(g=>{o.registerField(g)})})}}),z=(e,o)=>({id:f.generateId("node"),position:[0,0],experience:o,type:"action",action:e.action,addNext(n){if(!n.node)throw new Error("Cannot connect to node");const d=h({sourceNode:this,destinationNode:n.node,sourceNodeHandle:null},o);o.edges.push(d)},onSuccess(n){if(!n.node)throw new Error("Cannot connect to node");const d=h({sourceNode:this,destinationNode:n.node,sourceNodeHandle:"true"},o);o.edges.push(d)},onFail(n){if(!n.node)throw new Error("Cannot connect to node");const d=h({sourceNode:this,destinationNode:n.node,sourceNodeHandle:"false"},o);o.edges.push(d)},serialize(){return r.serialize({id:this.id,type:this.type,action:this.action,position:this.position})}}),b=e=>({id:e.id??f.generateId("step"),label:e.label,fields:e.fields??[],addField(o){const s="serialize"in o?o:N(o);return this.fields?.includes(s)||this.fields?.push(s),s}}),v=(e,o)=>{const s={id:e.id??f.generateId("step"),label:e.label,experience:o,fields:e.fields??[],node:null,nextStep(n){return this.experience.addStep(n,this)},nextConditional(n){return this.experience.addConditional(n,this)},addNextExperience(n){return this.experience.addExperience(n,this)},addField(n){return this.experience.addField(n,this)},serialize(){return r.serialize({id:this.id,label:this.label,fieldIds:this.fields.map(n=>n.id)})}};return p({step:s,type:"step"},o),s},x=()=>[0,0],p=(e,o)=>{const s={id:f.generateId("node"),position:x(),experience:o};if(e.type==="step"){const d={...s,type:"step",connectedStep:e.step,serialize(){return r.serialize({id:this.id,type:this.type,stepId:this.connectedStep.id,position:this.position,label:this.connectedStep.label})}};return d.connectedStep.node=d,d}if(e.type==="conditional"){const d={...s,type:"conditional",connectedConditional:e.conditional,serialize(){return r.serialize({id:this.id,type:this.type,conditionalId:this.connectedConditional.id,position:this.position})}};return d.connectedConditional.node=d,d}return e.type==="experience"?{...s,type:"experience",connectedExperience:e.experience,serialize(){return r.serialize({id:this.id,type:this.type,experienceId:this.connectedExperience.id,position:this.position})}}:{...s,type:"origin",serialize(){return r.serialize({id:this.id,type:this.type,position:this.position})}}},h=(e,o)=>({id:f.generateId("edge"),sourceNode:e.sourceNode,sourceNodeHandle:e.sourceNodeHandle,destinationNode:e.destinationNode,experience:o,serialize(){return r.serialize({id:this.id,sourceNodeHandle:this.sourceNodeHandle??void 0,sourceNodeId:this.sourceNode.id,destinationNodeId:this.destinationNode.id})}}),m=(e,o)=>{const s={id:f.generateId("conditional"),label:e.label,condition:e.condition,node:null,experience:o,addTrue(n){if(!this.node||!n.node)throw new Error("todo no node");const d=h({sourceNode:this.node,destinationNode:n.node,sourceNodeHandle:"true"},this.experience);this.experience.edges.push(d)},addFalse(n){if(!this.node||!n.node)throw new Error("todo no node");const d=h({sourceNode:this.node,destinationNode:n.node,sourceNodeHandle:"false"},this.experience);this.experience.edges.push(d)},serialize(){return r.serialize({id:this.id,label:this.label,condition:this.condition})}};return p({conditional:s,type:"conditional"},o),s},N=e=>({id:e.id,name:e.name,type:e.type,label:e.label,placeholder:e.placeholder,description:e.description,helpText:e.helpText,defaultValue:e.defaultValue??null,multiple:e.multiple,validation:e.validation??{},condition:e.condition,required:e.required,options:e.options?.map(s=>({id:"id"in s?s.id:f.generateId("option"),...s}))??null,policies:e.policies,serialize(){const s={id:this.id,name:this.name,label:this.label,placeholder:this.placeholder,required:this.required,description:this.description,helpText:this.helpText,validation:this.validation,condition:this.condition,policies:this.policies},n=typeof this.defaultValue=="string"?this.defaultValue:void 0,d=typeof this.defaultValue=="number"?this.defaultValue:void 0,g=typeof this.defaultValue=="boolean"?this.defaultValue:void 0;switch(this.type){case"text":if(this.multiple){let t;if(Array.isArray(this.defaultValue)){t=[];for(const i of this.defaultValue)typeof i=="string"&&t.push(i);t.length===0&&(t=void 0)}return r.serialize({...s,type:"text",multiple:!0,defaultValue:t,options:this.options?this.options.map(i=>({id:i.id,label:i.label,value:`${i.value}`,condition:i.condition})):null})}return r.serialize({...s,type:"text",multiple:!1,defaultValue:n,options:this.options?this.options.map(t=>({id:t.id,label:t.label,value:`${t.value}`,condition:t.condition})):null});case"number":if(this.multiple){let t;if(Array.isArray(this.defaultValue)){t=[];for(const i of this.defaultValue)typeof i=="number"&&t.push(i);t.length===0&&(t=void 0)}return r.serialize({...s,type:"number",multiple:!0,defaultValue:t,options:this.options?this.options.map(i=>({id:i.id,label:i.label,value:Number(i.value),condition:i.condition})):null})}return r.serialize({...s,type:"number",multiple:!1,defaultValue:d,options:this.options?this.options.map(t=>({id:t.id,label:t.label,value:Number(t.value),condition:t.condition})):null});case"boolean":if(this.multiple){let t;if(Array.isArray(this.defaultValue)){t=[];for(const i of this.defaultValue)typeof i=="boolean"&&t.push(i);t.length===0&&(t=void 0)}return r.serialize({...s,type:"boolean",multiple:!0,defaultValue:t,options:this.options?this.options.map(i=>({id:i.id,label:i.label,value:!!i.value,condition:i.condition})):null})}return r.serialize({...s,type:"boolean",multiple:!1,defaultValue:g,options:this.options?this.options.map(t=>({id:t.id,label:t.label,value:!!t.value,condition:t.condition})):null});case"object":return this.multiple?r.serialize({...s,type:"object",multiple:!0,defaultValue:this.defaultValue,options:this.options?this.options.map(t=>({id:t.id,label:t.label,description:t.description,value:t.value,condition:t.condition})):null}):r.serialize({...s,type:"object",multiple:!1,defaultValue:this.defaultValue,options:this.options?this.options.map(t=>({id:t.id,label:t.label,description:t.description,value:t.value,condition:t.condition})):null});default:throw new Error("Unsupported field type")}}}),E=e=>{const o=[],s=[],n=[],d=[],g=[],t=e.condition??e.decide;return{id:e.id,component:e.component,name:e.name,initializeOpen:e.initializeOpen,condition:t,decide:e.decide,targets:e.targets,steps:o,nodes:s,edges:n,fields:g,conditionals:d,addStep(i,u){let l=u?.node;this.nodes.length===0&&(l=p({type:"origin"},this),this.nodes.push(l));const a="serialize"in i?i:v(i,this);if(l){if(!a.node)throw new Error("todo no node");const c=h({sourceNode:l,destinationNode:a.node,sourceNodeHandle:null},this);this.edges.push(c)}return a.fields.length>0&&a.fields.forEach(c=>{this.fields.includes(c)||this.fields.push(c)}),this.steps.includes(a)||(this.steps.push(a),a.node&&this.nodes.push(a.node)),a},addAction(i,u){let l=u?.node;this.nodes.length===0&&(l=p({type:"origin"},this),this.nodes.push(l));const a="serialize"in i?i:z(i,this);if(l){const c=h({sourceNode:l,destinationNode:a,sourceNodeHandle:null},this);this.edges.push(c)}return this.nodes.push(a),a},addConditional(i,u){let l=u?.node;this.nodes.length===0&&(l=p({type:"origin"},this),this.nodes.push(l));const a="serialize"in i?i:m(i,this);if(l){if(!a.node)throw new Error("todo no node");const c=h({sourceNode:l,destinationNode:a.node,sourceNodeHandle:null},this);this.edges.push(c)}return this.conditionals.includes(a)||(this.conditionals.push(a),a.node&&this.nodes.push(a.node)),a},addExperience(i,u){let l=u?.node;this.nodes.length===0&&(l=p({type:"origin"},this),this.nodes.push(l));const a=p({type:"experience",experience:i},this);if(this.nodes.push(a),l){const c=h({sourceNode:l,destinationNode:a,sourceNodeHandle:null},this);this.edges.push(c)}return i},addField(i,u){const l="serialize"in i?i:N(i);return u&&u.fields.push(l),this.fields.includes(l)||this.fields.push(l),l},serialize(){return r.serialize({id:this.id,component:this.component,name:this.name,initializeOpen:this.initializeOpen,condition:this.condition??this.decide,decide:this.decide,targets:this.targets,steps:this.steps.map(i=>r.deserialize(i.serialize())),nodes:this.nodes.map(i=>r.deserialize(i.serialize())),edges:this.edges.map(i=>r.deserialize(i.serialize())),conditionals:this.conditionals.map(i=>r.deserialize(i.serialize())),fields:this.fields.map(i=>r.deserialize(i.serialize()))})}}};exports.createConditional=m;exports.createEdge=h;exports.createExperience=E;exports.createExperiencePlugin=y;exports.createField=N;exports.createNode=p;exports.createStep=b;exports.serialization=r;
package/dist/esm/index.js CHANGED
@@ -828,7 +828,7 @@ const Qe = F("response"), Xe = b(({ client: t }) => {
828
828
  function Ze(t) {
829
829
  return I(Xe, t);
830
830
  }
831
- const et = () => "0.0.47-next.1";
831
+ const et = () => "0.0.47-next.2";
832
832
  function tt() {
833
833
  if (L()) {
834
834
  const t = [
@@ -169,6 +169,7 @@ const r = {
169
169
  }), b = (e, o) => {
170
170
  const s = {
171
171
  id: f("conditional"),
172
+ label: e.label,
172
173
  condition: e.condition,
173
174
  node: null,
174
175
  experience: o,
@@ -193,6 +194,7 @@ const r = {
193
194
  serialize() {
194
195
  return r.serialize({
195
196
  id: this.id,
197
+ label: this.label,
196
198
  condition: this.condition
197
199
  });
198
200
  }
@@ -185,6 +185,7 @@ export interface ExperienceEdge {
185
185
  }
186
186
  export interface ExperienceConditional {
187
187
  id: string;
188
+ label?: string;
188
189
  condition: LogicRule;
189
190
  }
190
191
  export interface ExperienceTarget {
@@ -1 +1 @@
1
- {"version":3,"file":"experience.d.ts","sourceRoot":"","sources":["../../../../src/entities/experience/experience.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAC9D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAG1C,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAE/D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAE3C,MAAM,MAAM,oBAAoB,GAAG,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAC3E,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAIjE,QAAA,MA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AE,gBAAgB,EAAE,CAAA;CAC5B;AAED,eAAO,MAAM,eAAe,GAC1B,YAAY,UAAU,EACtB,iBAAiB,oBAAoB,KACpC,IAEF,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,GAC/B,QAAQ,MAAM,EACd,YAAY,eAAe,EAC3B,UAAU,uBAAuB,SAkBlC,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,GAAU,QAAQ,MAAM,kBASzD,CAAA;AAsBD,eAAO,MAAM,0BAA0B,GACrC,QAAQ,MAAM,EACd,YAAY,eAAe,KAC1B,OAAO,CAAC,OAAO,CA4BjB,CAAA"}
@@ -86,6 +86,7 @@ export interface CreateEdgeOptions {
86
86
  }
87
87
  export interface SerializableConditional extends Nodeable {
88
88
  id: string;
89
+ label?: string;
89
90
  condition: LogicRule;
90
91
  experience: SerializableExperience;
91
92
  addTrue: (nodeable: Nodeable) => undefined;
@@ -94,6 +95,7 @@ export interface SerializableConditional extends Nodeable {
94
95
  }
95
96
  export interface CreateConditionalOptions {
96
97
  condition: LogicRule;
98
+ label?: string;
97
99
  }
98
100
  export type CreateFieldOptions = Omit<Field, 'options' | 'placeholder' | 'description' | 'helpText' | 'validation' | 'policies' | 'defaultValue'> & {
99
101
  defaultValue?: string | number | boolean | object | null | string[] | number[] | boolean[] | object[];
@@ -1 +1 @@
1
- {"version":3,"file":"create-experience.d.ts","sourceRoot":"","sources":["../../../../src/plugins/create-experience/create-experience.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EAEV,UAAU,EACV,qBAAqB,EACrB,cAAc,EACd,cAAc,EACd,cAAc,EACd,gBAAgB,EAGjB,MAAM,sCAAsC,CAAA;AAC7C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAA;AAE1E,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/D,OAAO,KAAK,EACV,KAAK,EACL,oBAAoB,E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AG;IACF,QAAQ,EAAE,CAAC,mBAAmB,EAAE,kBAAkB,GAAG,iBAAiB,KAAK,IAAI,CAAA;CAChF,CAAA;AAED,eAAO,MAAM,UAAU,GAAI,aAAa,iBAAiB,KAAG,UAgB3D,CAAA;AAED,eAAO,MAAM,kBAAkB,GAC7B,aAAa,iBAAiB,GAAG,UAAU,EAC3C,YAAY,sBAAsB,KACjC,gBA+BF,CAAA;AAID,eAAO,MAAM,UAAU,GACrB,aAAa,iBAAiB,EAC9B,YAAY,sBAAsB,KACjC,gBA+EF,CAAA;AAED,eAAO,MAAM,UAAU,GACrB,aAAa,iBAAiB,EAC9B,YAAY,sBAAsB,KACjC,gBAkBF,CAAA;AAED,eAAO,MAAM,iBAAiB,GAC5B,oBAAoB,wBAAwB,EAC5C,YAAY,sBAAsB,KACjC,uBA0CF,CAAA;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,WAAW,GAAI,CAAC,SAAS,SAAS,GAAG,SAAS,EACzD,cAAc,kBAAkB,KAC/B,iBAAiB,CAAC,CAAC,CAiOrB,CAAA;AAED,eAAO,MAAM,gBAAgB,GAAI,YAAY,uBAAuB,KAAG,sBA2LtE,CAAA"}
1
+ {"version":3,"file":"create-experience.d.ts","sourceRoot":"","sources":["../../../../src/plugins/create-experience/create-experience.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EAEV,UAAU,EACV,qBAAqB,EACrB,cAAc,EACd,cAAc,EACd,cAAc,EACd,gBAAgB,EAGjB,MAAM,sCAAsC,CAAA;AAC7C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAA;AAE1E,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/D,OAAO,KAAK,EACV,KAAK,EACL,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB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BAAmB,EAAE,kBAAkB,GAAG,iBAAiB,KAAK,IAAI,CAAA;CAChF,CAAA;AAED,eAAO,MAAM,UAAU,GAAI,aAAa,iBAAiB,KAAG,UAgB3D,CAAA;AAED,eAAO,MAAM,kBAAkB,GAC7B,aAAa,iBAAiB,GAAG,UAAU,EAC3C,YAAY,sBAAsB,KACjC,gBA+BF,CAAA;AAID,eAAO,MAAM,UAAU,GACrB,aAAa,iBAAiB,EAC9B,YAAY,sBAAsB,KACjC,gBA+EF,CAAA;AAED,eAAO,MAAM,UAAU,GACrB,aAAa,iBAAiB,EAC9B,YAAY,sBAAsB,KACjC,gBAkBF,CAAA;AAED,eAAO,MAAM,iBAAiB,GAC5B,oBAAoB,wBAAwB,EAC5C,YAAY,sBAAsB,KACjC,uBA4CF,CAAA;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,WAAW,GAAI,CAAC,SAAS,SAAS,GAAG,SAAS,EACzD,cAAc,kBAAkB,KAC/B,iBAAiB,CAAC,CAAC,CAiOrB,CAAA;AAED,eAAO,MAAM,gBAAgB,GAAI,YAAY,uBAAuB,KAAG,sBA2LtE,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@picked/client",
3
- "version": "0.0.47-next.1",
3
+ "version": "0.0.47-next.2",
4
4
  "dependencies": {
5
5
  "@withease/factories": "^1.0.5"
6
6
  },