@picked/client 0.0.1-dev.1773363643396 → 0.0.1-dev.1773365725739

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.
@@ -5,7 +5,7 @@ function u(n, t) {
5
5
  [a]: t
6
6
  };
7
7
  }
8
- const d = () => "0.0.1-dev.1773363643396", E = "v1";
8
+ const d = () => "0.0.1-dev.1773365725739", E = "v1";
9
9
  function s(n, t) {
10
10
  return new URL(`/api/${E}/${t}`, n).toString();
11
11
  }
@@ -1 +1 @@
1
- "use strict";const a="Picked-Client",d="Picked-Version";function s(e,t){return{[a]:e,[d]:t}}const o=()=>"0.0.1-dev.1773363643396",E="v1";function c(e,t){return new URL(`/api/${E}/${t}`,e).toString()}function i(e){return{...s("sdk",o()),...e}}async function f(e,t,n){const r=c(e,t);return fetch(r,{headers:i(n)})}async function l(e,t,n,r){const u=c(e,t);return fetch(u,{method:"POST",headers:{"Content-Type":"application/json",...i(r)},body:JSON.stringify(n)})}exports.createClientHeaders=s;exports.get=f;exports.getVersion=o;exports.post=l;
1
+ "use strict";const a="Picked-Client",d="Picked-Version";function s(e,t){return{[a]:e,[d]:t}}const o=()=>"0.0.1-dev.1773365725739",E="v1";function c(e,t){return new URL(`/api/${E}/${t}`,e).toString()}function i(e){return{...s("sdk",o()),...e}}async function f(e,t,n){const r=c(e,t);return fetch(r,{headers:i(n)})}async function l(e,t,n,r){const u=c(e,t);return fetch(u,{method:"POST",headers:{"Content-Type":"application/json",...i(r)},body:JSON.stringify(n)})}exports.createClientHeaders=s;exports.get=f;exports.getVersion=o;exports.post=l;
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"),E=require("../logger-BsmHUUw1.cjs"),w=require("../storage-Be5xWNPC.cjs"),U=require("../api-C7ddxkUx.cjs"),H=require("../id-BKIWbSTy.cjs"),G=require("../object-BbFTsGh3.cjs"),W=require("../to-kebab-case-BsOQ8CON.cjs"),k=require("../supports-YvpQZxbh.cjs"),L=g.createDomain("experience"),J=S.createFactory(({client:t,experience:e})=>{const r=L.store(e),s=g.createApi(r,{merge(u,m){return{...u,...m.experience}}}),n=r.map(u=>({name:u.name,decisionLogic:u.condition,targetSelectors:u.targets,initializeOpenLogic:e.initializeOpen})),p=t.components.listStore.map(u=>(e.componentName?u.find(m=>m.name===e.componentName):void 0)||u.find(m=>m.name===`experience:${e.id}`)||u.find(m=>m.name==="experience"),{skipVoid:!1}),o=r.map(u=>({steps:u.steps,nodes:u.nodes,edges:u.edges,conditionals:u.conditionals})),c=r.map(u=>u.fields),a=e.actions??[];return{id:e.id,configStore:n,treeStore:o,fieldsStore:c,componentStore:p,actions:a,merge:s.merge}});function Y(t){return S.invoke(J,t)}const Q=S.createFactory(({client:t})=>{const e=L.store({}),r=g.createApi(e,{register(a,u){return{...a,[u.id]:u}}});function s(a){const u=e.getState()[a.id];if(u){u.merge({experience:a,strategy:"override"});return}const m=Y({client:t,experience:a});r.register(m)}const n=e.map(a=>Object.values(a));function p(a){return e.map(u=>u[a],{skipVoid:!1})}const o=g.attach({source:e,effect:async(a,{id:u,options:m})=>{const b=a[u];if(!b){E.logger("warn",`Experience with id '${u}' not found.`);return}if(m?.bypassCondition){$(t,b,m);return}await V(t,b)&&$(t,b,m)}}),c=g.attach({source:t.experienceInstances.listStore,effect:(a,{id:u,options:m})=>{const b=a.filter(y=>y.experienceId===u);if(b.length>0)for(const y of b)y.open();else o({id:u,options:{...m,initialiseOpen:!0}})}});return{register:s,get:p,getById:p,launch:o,open:c,listStore:n}});function X(t){return S.invoke(Q,t)}const Z=(t,e)=>{e.register(t)},$=(t,e,r)=>{const{targetSelectors:s}=e.configStore.getState(),n=I.getTargetElements(s,e.id);n.forEach(({elements:o})=>o.forEach(c=>I.tagTargetElement(c,e.id))),I.createAppHosts(n,e.id).forEach(o=>{r?t.experienceInstances.spawn(e,o,r):t.experienceInstances.spawn(e,o)})},z=async t=>{await Promise.all(t.experiences.listStore.getState().map(async e=>{await V(t,e)&&$(t,e)}))},V=async(t,e)=>{if(!t.preconditionPassed||!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},ee=(t,e,r)=>{const s=e.name,n=e.setup(t);if(n){const p=r[s]??{};r[s]=Object.freeze({...p,...n})}},te=g.createDomain("component"),re=S.createFactory(({client:t,component:e,name:r})=>{const s=t.frameworks.getByName(e.frameworkName);return{name:r,component:e,frameworkStore:s}});function se(t){return S.invoke(re,t)}const ne=S.createFactory(({client:t})=>{const e=te.store({}),r=g.createApi(e,{register(o,c){return{...o,[c.name]:c}}});function s(o,c){e.getState()[o]&&E.logger("warn",`Component '${o}' already registered. Registering again will override the previous registration.`);const u=se({client:t,name:o,component:c});r.register(u)}const n=e.map(o=>Object.values(o));function p(o){return e.map(c=>c[o],{skipVoid:!1})}return{register:s,getByName:p,listStore:n}});function ie(t){return S.invoke(ne,t)}const B=(t,e,r)=>{r.register(t,e)},oe=g.createDomain("framework"),ae=S.createFactory(({client:t})=>{const e=oe.store({}),r=g.createApi(e,{register(o,c){return{...o,[c.name]:c.framework}}});function s(o,c){e.getState()[o]&&E.logger("warn",`Framework '${o}' already registered. Registering again will override the previous registration.`),r.register({name:o,framework:c})}const n=e.map(o=>Object.values(o));function p(o){return e.map(c=>c[o],{skipVoid:!1})}return{register:s,getByName:p,listStore:n}});function ce(t){return S.invoke(ae,t)}const ue=(t,e)=>{e.register(t.name,t)},le=6e3,de=w.createStorageKey("last_ping","global"),pe=async t=>{try{const e=Date.now(),r=w.localStore.get(de);let s=0;if(r.isSet()&&(s=r.json()??0),s&&e-s<le)return!0;const n={projectId:t.projectId,path:window.location.pathname},p={},c=document.getElementById("picked_script")?.dataset.verceltoken;c&&(p["x-vercel-protection-bypass"]=c);const u=(await U.post(t.apiUrl,"ping",n,p)).ok;return u&&r.set(e),u}catch(e){return E.logger("error",e),!1}};function N(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 fe=g.createDomain("predicate"),ge=S.createFactory(({client:t})=>{const e=fe.store({}),r=g.createApi(e,{register(c,a){return{...c,[a.name]:{name:a.name,predicate:a.predicate}}}});function s(c,a){e.getState()[c]&&E.logger("warn",`Predicate '${c}' already registered. Registering again will override the previous registration.`),r.register(Object.freeze({name:c,predicate:a}))}const n=e.map(c=>Object.values(c));function p(c){return e.map(a=>a[c]?.predicate,{skipVoid:!1})}function o(c){const a=g.createStore(()=>{},{skipVoid:!1}),u=g.createEffect(async()=>{const m=p(c).getState();if(!m)return;const b=N(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:a}),u(),a}return{register:s,getByName:p,listStore:n,getEvokablePredicate:o}});function me(t){return S.invoke(ge,t)}const ye=(t,e,r)=>{r.register(t,e)},D=g.createDomain("feature"),he=S.createFactory(({client:t})=>{const e=D.store({}),r=D.store([]),s=g.createApi(e,{register(i,l){return{...i,[l.id]:l.feature}}});function n(i,l){e.getState()[i]&&E.logger("warn",`Feature '${i}' already registered. Registering again will override the previous registration.`);const d={id:i,feature:{...l,id:i}};s.register(Object.freeze({id:i,feature:d}))}const p=g.createEffect(async({id:i,key:l,storage:f="local"})=>{const d=w.createStorageKey(`feature:${i}:${l}`,"global"),v=(f==="session"?w.sessionStore:w.localStore).get(d).boolean();return v===null?null:{id:i,key:l,bucket:v,storage:f}}),o=g.createEffect(i=>{if(!i)return null;const l=w.createStorageKey(`feature:${i.id}:${i.key}`,"global");(i.storage==="session"?w.sessionStore:w.localStore).set(l,i.bucket)}),c=new Map,a=g.attach({source:{allFeaturesStore:e,resolvedFeaturesStore:r},effect:async({allFeaturesStore:i,resolvedFeaturesStore:l},{id:f,decide:d,key:h})=>{const v=l.find(P=>P.id===f&&P.key===h);if(v)return v;const x=i[f];if(!x)throw new Error(`Feature with id '${f}' not found`);const A=c.get(`${f}:${h}`);if(A!==void 0){const P=await A;return{id:x.id,bucket:P,key:h,storage:x.feature.storage}}const F=d();c.set(`${f}:${h}`,F);const q=await F;return{id:x.id,bucket:q,key:h,storage:x.feature.storage}}});g.sample({clock:s.register,fn:i=>{const{id:l,feature:f}=i;return{id:l,key:f.feature.key,storage:f.feature.storage}},target:p}),g.sample({source:e,clock:a.doneData,fn:(i,l)=>{const{id:f,bucket:d,storage:h}=l,v=i[f]?.feature.key;return v?{key:v,id:f,bucket:d,storage:h}:null},target:o});const u=g.combine({allFeaturesStore:e,resolvedFeaturesStore:r}).map(({allFeaturesStore:i,resolvedFeaturesStore:l})=>Object.values(i).map(f=>{const d=l.find(h=>h.id===f.id&&h.key===f.feature.key);return d?{id:f.id,name:f.feature.name,key:f.feature.key,getBucket:()=>({id:f.id,bucket:d.bucket}),isResolved:!0}:{id:f.id,name:f.feature.name,key:f.feature.key,getBucket:async()=>await a(f.feature),isResolved:!1}}));g.sample({clock:a.doneData,source:{resolvedFeatures:r},filter:({resolvedFeatures:i},{id:l,key:f})=>!i.some(h=>h.id===l&&h.key===f),fn:(i,l)=>l,target:t.eventBus.prepend(i=>({type:"feature_decide",feature:i}))}),g.sample({clock:[p.doneData,a.doneData],source:r,fn:(i,l)=>!l||i.some(d=>d.id===l.id&&d.key===l.key)?i:[...i,l],target:r});function m(i){return u.map(l=>l.find(f=>f.id===i))}function b(i){return e.map(l=>l[i],{skipVoid:!1})}function y(i){const l=g.createStore(async()=>{},{skipVoid:!1}),f=g.createEffect(async()=>{const d=m(i).getState();if(d)return async()=>(await d.getBucket()).bucket});return g.sample({source:r,filter:d=>d.some(h=>h.id===i),target:f}),g.sample({clock:f.doneData,filter:d=>d!==void 0,target:l}),f(),l}return{register:n,getById:m,getByName:b,listStore:u,getEvokableFeature:y}});function Se(t){return S.invoke(he,t)}const ve=(t,e,r)=>{r.register(t,e)},j=g.createDomain("history");function O(t,e){return{id:H.generateId(`history-entry-${Date.now()}-${Math.random()}}`),node:e,at:Date.now(),experienceId:t}}const ke=S.createFactory(()=>{const t=j.store({entries:[]}),e=j.event(),r=j.event(),s=j.event(),n=j.event();t.on(e,(o,c)=>({entries:[...o.entries,O(c.experienceId,c.node)]})),t.on(r,(o,c)=>({entries:[...o.entries.slice(0,-1),O(c.experienceId,c.node)]})),t.on(n,(o,c)=>c);function p(o,c){const a={lastStepIndex:-1,secondLastStepIndex:-1};for(let u=o.length-1;u>=0;u--){const m=o[u],b=m?.node;if(!(!b||!I.isStepNode(b))&&!(c&&m?.experienceId!==c))if(a.lastStepIndex===-1)a.lastStepIndex=u;else{a.secondLastStepIndex=u;break}}return a}return t.on(s,(o,c)=>{const{secondLastStepIndex:a}=p(o.entries,c.experienceId),u=a!==-1?o.entries.slice(0,a+1):o.entries;return{...o,entries:u}}),{push:e,replace:r,back:s,restore:n,entriesStore:t.map(o=>o.entries)}});function be(){return S.invoke(ke)}let we=0;const Ie=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},Fe=g.createDomain("field"),Ee=S.createFactory(()=>{const t=Fe.store({}),e=g.createApi(t,{register(a,u){return{...a,[u.resolvedKey]:{...u.field,key:u.resolvedKey}}}});function r(a){e.register({field:a,resolvedKey:a.key})}function s(a,u){const m=p(a).getState();if(!m)return;const b=Object.assign({},m,{...u});e.register({field:{...b},resolvedKey:a})}const n=t.map(a=>Object.values(a));function p(a){return t.map(u=>u[a]||null)}function o(a){return t.map(u=>Object.values(u).find(m=>m.id===a)||null)}function c(a){return t.map(u=>Object.values(u).find(m=>m.name===a)||null)}return{register:r,update:s,getByKey:p,getById:o,listStore:n,getByName:c}});function xe(){return S.invoke(Ee)}const je=(t,e)=>{e.register(t)},Ae=g.createDomain("action"),Pe=S.createFactory(()=>{const t=Ae.store({}),e=g.createApi(t,{register(o,c){return{...o,[c.name]:{name:c.name,action:c.action}}}});function r(o,c){e.register({name:o,action:c})}const s=t.map(o=>Object.values(o));function n(o){return t.map(c=>c[o],{skipVoid:!1})}function p(o){return t.map(c=>{const a=c[o];return a?a.action:void 0},{skipVoid:!1})}return{register:r,getByName:n,listStore:s,getEvokableAction:p}});function Re(){return S.invoke(Pe)}const Ce=(t,e,r)=>{r.register(t,e)};function C(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 ze=g.createDomain("response"),Be=S.createFactory(({client:t})=>{const e=ze.store({}),r=g.createEvent(),s=g.createEvent(),n=g.createApi(e,{register(y,i){return{...y,[i.fieldId]:i.response}},registerBatch(y,i){return{...y,...i}},clear(y,i){const{[i]:l,...f}=y;return f},clearAll(){return{}}});function p(y,i){if(typeof y=="string"){if(i===void 0)throw new Error("Response is required when registering a single field");n.register({fieldId:y,response:i})}else n.registerBatch(y)}async function o(y){const i=[];return await Promise.allSettled(Object.entries(y).map(async([l,f])=>{let d=f;const h=t.fields.getByKey(l).getState();if(!h){i.push({fieldId:l,userMessage:`Field '${l}' not found`,systemMessage:`No field with ID '${l}' exists. Available field IDs are: ${Object.keys(t.fields.listStore.getState()).join(",")}.`,value:d});return}if(h.multiple&&(typeof d=="string"||typeof d=="number"||typeof d=="boolean")&&(d=[d]),h.validation&&!G.isEmpty(h.validation)&&!C(d)){const v=await I.evaluateRuleLogic(t,h.validation,{$input:d});if(typeof v=="string"){i.push({fieldId:l,userMessage:v,systemMessage:`Field validation resulted in an error: ${v}.`,value:d});return}if(v===!1){i.push({fieldId:l,userMessage:"This field is invalid",systemMessage:"Field validation resulted in an unspecified error.",value:d});return}}if(h.required&&C(d)){i.push({fieldId:l,userMessage:"This field is required",systemMessage:"Field is required.",value:d});return}if(!h.multiple&&Array.isArray(d)&&d.length>1){i.push({fieldId:l,userMessage:"This field expects a single response",systemMessage:"Field expects a single response.",value:d});return}if(h.type==="object"&&!C(d))if(h.multiple){if(!Array.isArray(d)){i.push({fieldId:l,userMessage:"This field expects multiple values",systemMessage:"Field expects an array of objects.",value:d});return}for(const v of d){if(typeof v!="object"||v===null){i.push({fieldId:l,userMessage:"This field expects object values",systemMessage:"Field expects an array of objects, but received non-object value.",value:d});return}if(!M(v)){i.push({fieldId:l,userMessage:"This field contains non-serializable data",systemMessage:"Field value contains non-JSON-serializable data (functions, circular references, etc.).",value:d});return}}}else{if(Array.isArray(d)){i.push({fieldId:l,userMessage:"This field expects a single value",systemMessage:"Field expects a single object, not an array.",value:d});return}if(typeof d!="object"||d===null){i.push({fieldId:l,userMessage:"This field expects an object value",systemMessage:"Field expects an object value.",value:d});return}if(!M(d)){i.push({fieldId:l,userMessage:"This field contains non-serializable data",systemMessage:"Field value contains non-JSON-serializable data (functions, circular references, etc.).",value:d});return}}if(Array.isArray(h.options)&&h.options.length>0){const v=Array.isArray(d)?d:[d];if(h.type==="object"){const x=h.options.map(F=>JSON.stringify(F.value));v.every(F=>x.includes(JSON.stringify(F)))||i.push({fieldId:l,userMessage:"This field expects a valid option",systemMessage:"Field expects a valid option from the defined choices.",value:d})}else{const x=h.options.map(F=>F.value);v.every(F=>!$e(F)||F===null?!1:x.includes(F))||i.push({fieldId:l,userMessage:"This field expects a valid option",systemMessage:`Field expects a valid option. Valid options are: ${x.join(", ")}`,value:d})}}})),{responsesToCommit:y,validationErrors:i}}async function c(y){const{responsesToCommit:i,validationErrors:l}=await o(y);return l.length?{errors:l}:(n.registerBatch(i),{errors:[]})}const a=e.map(y=>y),u=e.map(y=>Object.keys(y).map(l=>({fieldId:l,value:y[l]})));function m(y){const i=t.fields.getByKey(y),l=e.map(f=>f[y]||null);return g.combine({f:i,r:l},({f,r:d})=>d||(f?.defaultValue?f.defaultValue:null))}function b(y){const i=t.fields.getByName(y);return g.combine({f:i,s:e},({f:l,s:f})=>{const d=l&&f[l.key??W.toKebabCase(l.name)]||null;return d||(l?.defaultValue?l.defaultValue:null)})}return g.sample({clock:r,target:n.clearAll}),g.sample({clock:s,target:n.clear}),{register:p,clearAll:r,clear:s,commit:c,getResponsesToCommit:o,listStore:u,getAllStore:a,getByFieldId:m,getByFieldName:b}});function De(t){return S.invoke(Be,t)}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[n]of t.entries())n.startsWith("picked-")&&r.add(n);for(const n of r){const p=n.replace("picked-","");e[p]=t.getAll(n)}const s=w.createStorageKey("s");if(r.size>0)w.sessionStore.set(s,e);else{const n=w.sessionStore.get(s);if(n)return n.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=n=>t.set({id:n.id,isUser:n.isUser,identifiers:n.identifiers}),s={id:e?.id??Ue(),isUser:e?.isUser??void 0,identifiers:e?.identifiers??void 0,setIsUser(n){this.isUser=n,r(this)},setIdentifier(n,p){this.identifiers={...this.identifiers,[n]:p},r(this)},removeIdentifier(n){this.identifiers&&(this.identifiers=Object.fromEntries(Object.entries(this.identifiers).filter(([p])=>p!==n)),this.identifiers=Object.keys(this.identifiers).length?this.identifiers:void 0,r(this))}};return r(s),s},Ne=()=>k.supportsLocalStorage()?Ve():null;function T(){if(k.supportsWindow())return globalThis.window.pickedConfig}function Te(){if(!k.supportsWindow())return;const t=T(),e=t?.organizationId,r=t?.projectId;return e&&r?{organizationId:e,projectId:r}:void 0}function Ke(){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 _e(t){const{organizationId:e,projectId:r}=t;if(e&&r)return{organizationId:e,projectId:r};const s=Te();if(s)return s;const n=Ke();if(n)return n;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"),E=require("../logger-BsmHUUw1.cjs"),w=require("../storage-Be5xWNPC.cjs"),U=require("../api-F0IOGUor.cjs"),H=require("../id-BKIWbSTy.cjs"),G=require("../object-BbFTsGh3.cjs"),W=require("../to-kebab-case-BsOQ8CON.cjs"),k=require("../supports-YvpQZxbh.cjs"),L=g.createDomain("experience"),J=S.createFactory(({client:t,experience:e})=>{const r=L.store(e),s=g.createApi(r,{merge(u,m){return{...u,...m.experience}}}),n=r.map(u=>({name:u.name,decisionLogic:u.condition,targetSelectors:u.targets,initializeOpenLogic:e.initializeOpen})),p=t.components.listStore.map(u=>(e.componentName?u.find(m=>m.name===e.componentName):void 0)||u.find(m=>m.name===`experience:${e.id}`)||u.find(m=>m.name==="experience"),{skipVoid:!1}),o=r.map(u=>({steps:u.steps,nodes:u.nodes,edges:u.edges,conditionals:u.conditionals})),c=r.map(u=>u.fields),a=e.actions??[];return{id:e.id,configStore:n,treeStore:o,fieldsStore:c,componentStore:p,actions:a,merge:s.merge}});function Y(t){return S.invoke(J,t)}const Q=S.createFactory(({client:t})=>{const e=L.store({}),r=g.createApi(e,{register(a,u){return{...a,[u.id]:u}}});function s(a){const u=e.getState()[a.id];if(u){u.merge({experience:a,strategy:"override"});return}const m=Y({client:t,experience:a});r.register(m)}const n=e.map(a=>Object.values(a));function p(a){return e.map(u=>u[a],{skipVoid:!1})}const o=g.attach({source:e,effect:async(a,{id:u,options:m})=>{const b=a[u];if(!b){E.logger("warn",`Experience with id '${u}' not found.`);return}if(m?.bypassCondition){$(t,b,m);return}await V(t,b)&&$(t,b,m)}}),c=g.attach({source:t.experienceInstances.listStore,effect:(a,{id:u,options:m})=>{const b=a.filter(y=>y.experienceId===u);if(b.length>0)for(const y of b)y.open();else o({id:u,options:{...m,initialiseOpen:!0}})}});return{register:s,get:p,getById:p,launch:o,open:c,listStore:n}});function X(t){return S.invoke(Q,t)}const Z=(t,e)=>{e.register(t)},$=(t,e,r)=>{const{targetSelectors:s}=e.configStore.getState(),n=I.getTargetElements(s,e.id);n.forEach(({elements:o})=>o.forEach(c=>I.tagTargetElement(c,e.id))),I.createAppHosts(n,e.id).forEach(o=>{r?t.experienceInstances.spawn(e,o,r):t.experienceInstances.spawn(e,o)})},z=async t=>{await Promise.all(t.experiences.listStore.getState().map(async e=>{await V(t,e)&&$(t,e)}))},V=async(t,e)=>{if(!t.preconditionPassed||!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},ee=(t,e,r)=>{const s=e.name,n=e.setup(t);if(n){const p=r[s]??{};r[s]=Object.freeze({...p,...n})}},te=g.createDomain("component"),re=S.createFactory(({client:t,component:e,name:r})=>{const s=t.frameworks.getByName(e.frameworkName);return{name:r,component:e,frameworkStore:s}});function se(t){return S.invoke(re,t)}const ne=S.createFactory(({client:t})=>{const e=te.store({}),r=g.createApi(e,{register(o,c){return{...o,[c.name]:c}}});function s(o,c){e.getState()[o]&&E.logger("warn",`Component '${o}' already registered. Registering again will override the previous registration.`);const u=se({client:t,name:o,component:c});r.register(u)}const n=e.map(o=>Object.values(o));function p(o){return e.map(c=>c[o],{skipVoid:!1})}return{register:s,getByName:p,listStore:n}});function ie(t){return S.invoke(ne,t)}const B=(t,e,r)=>{r.register(t,e)},oe=g.createDomain("framework"),ae=S.createFactory(({client:t})=>{const e=oe.store({}),r=g.createApi(e,{register(o,c){return{...o,[c.name]:c.framework}}});function s(o,c){e.getState()[o]&&E.logger("warn",`Framework '${o}' already registered. Registering again will override the previous registration.`),r.register({name:o,framework:c})}const n=e.map(o=>Object.values(o));function p(o){return e.map(c=>c[o],{skipVoid:!1})}return{register:s,getByName:p,listStore:n}});function ce(t){return S.invoke(ae,t)}const ue=(t,e)=>{e.register(t.name,t)},le=6e3,de=w.createStorageKey("last_ping","global"),pe=async t=>{try{const e=Date.now(),r=w.localStore.get(de);let s=0;if(r.isSet()&&(s=r.json()??0),s&&e-s<le)return!0;const n={projectId:t.projectId,path:window.location.pathname},p={},c=document.getElementById("picked_script")?.dataset.verceltoken;c&&(p["x-vercel-protection-bypass"]=c);const u=(await U.post(t.apiUrl,"ping",n,p)).ok;return u&&r.set(e),u}catch(e){return E.logger("error",e),!1}};function N(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 fe=g.createDomain("predicate"),ge=S.createFactory(({client:t})=>{const e=fe.store({}),r=g.createApi(e,{register(c,a){return{...c,[a.name]:{name:a.name,predicate:a.predicate}}}});function s(c,a){e.getState()[c]&&E.logger("warn",`Predicate '${c}' already registered. Registering again will override the previous registration.`),r.register(Object.freeze({name:c,predicate:a}))}const n=e.map(c=>Object.values(c));function p(c){return e.map(a=>a[c]?.predicate,{skipVoid:!1})}function o(c){const a=g.createStore(()=>{},{skipVoid:!1}),u=g.createEffect(async()=>{const m=p(c).getState();if(!m)return;const b=N(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:a}),u(),a}return{register:s,getByName:p,listStore:n,getEvokablePredicate:o}});function me(t){return S.invoke(ge,t)}const ye=(t,e,r)=>{r.register(t,e)},D=g.createDomain("feature"),he=S.createFactory(({client:t})=>{const e=D.store({}),r=D.store([]),s=g.createApi(e,{register(i,l){return{...i,[l.id]:l.feature}}});function n(i,l){e.getState()[i]&&E.logger("warn",`Feature '${i}' already registered. Registering again will override the previous registration.`);const d={id:i,feature:{...l,id:i}};s.register(Object.freeze({id:i,feature:d}))}const p=g.createEffect(async({id:i,key:l,storage:f="local"})=>{const d=w.createStorageKey(`feature:${i}:${l}`,"global"),v=(f==="session"?w.sessionStore:w.localStore).get(d).boolean();return v===null?null:{id:i,key:l,bucket:v,storage:f}}),o=g.createEffect(i=>{if(!i)return null;const l=w.createStorageKey(`feature:${i.id}:${i.key}`,"global");(i.storage==="session"?w.sessionStore:w.localStore).set(l,i.bucket)}),c=new Map,a=g.attach({source:{allFeaturesStore:e,resolvedFeaturesStore:r},effect:async({allFeaturesStore:i,resolvedFeaturesStore:l},{id:f,decide:d,key:h})=>{const v=l.find(P=>P.id===f&&P.key===h);if(v)return v;const x=i[f];if(!x)throw new Error(`Feature with id '${f}' not found`);const A=c.get(`${f}:${h}`);if(A!==void 0){const P=await A;return{id:x.id,bucket:P,key:h,storage:x.feature.storage}}const F=d();c.set(`${f}:${h}`,F);const q=await F;return{id:x.id,bucket:q,key:h,storage:x.feature.storage}}});g.sample({clock:s.register,fn:i=>{const{id:l,feature:f}=i;return{id:l,key:f.feature.key,storage:f.feature.storage}},target:p}),g.sample({source:e,clock:a.doneData,fn:(i,l)=>{const{id:f,bucket:d,storage:h}=l,v=i[f]?.feature.key;return v?{key:v,id:f,bucket:d,storage:h}:null},target:o});const u=g.combine({allFeaturesStore:e,resolvedFeaturesStore:r}).map(({allFeaturesStore:i,resolvedFeaturesStore:l})=>Object.values(i).map(f=>{const d=l.find(h=>h.id===f.id&&h.key===f.feature.key);return d?{id:f.id,name:f.feature.name,key:f.feature.key,getBucket:()=>({id:f.id,bucket:d.bucket}),isResolved:!0}:{id:f.id,name:f.feature.name,key:f.feature.key,getBucket:async()=>await a(f.feature),isResolved:!1}}));g.sample({clock:a.doneData,source:{resolvedFeatures:r},filter:({resolvedFeatures:i},{id:l,key:f})=>!i.some(h=>h.id===l&&h.key===f),fn:(i,l)=>l,target:t.eventBus.prepend(i=>({type:"feature_decide",feature:i}))}),g.sample({clock:[p.doneData,a.doneData],source:r,fn:(i,l)=>!l||i.some(d=>d.id===l.id&&d.key===l.key)?i:[...i,l],target:r});function m(i){return u.map(l=>l.find(f=>f.id===i))}function b(i){return e.map(l=>l[i],{skipVoid:!1})}function y(i){const l=g.createStore(async()=>{},{skipVoid:!1}),f=g.createEffect(async()=>{const d=m(i).getState();if(d)return async()=>(await d.getBucket()).bucket});return g.sample({source:r,filter:d=>d.some(h=>h.id===i),target:f}),g.sample({clock:f.doneData,filter:d=>d!==void 0,target:l}),f(),l}return{register:n,getById:m,getByName:b,listStore:u,getEvokableFeature:y}});function Se(t){return S.invoke(he,t)}const ve=(t,e,r)=>{r.register(t,e)},j=g.createDomain("history");function O(t,e){return{id:H.generateId(`history-entry-${Date.now()}-${Math.random()}}`),node:e,at:Date.now(),experienceId:t}}const ke=S.createFactory(()=>{const t=j.store({entries:[]}),e=j.event(),r=j.event(),s=j.event(),n=j.event();t.on(e,(o,c)=>({entries:[...o.entries,O(c.experienceId,c.node)]})),t.on(r,(o,c)=>({entries:[...o.entries.slice(0,-1),O(c.experienceId,c.node)]})),t.on(n,(o,c)=>c);function p(o,c){const a={lastStepIndex:-1,secondLastStepIndex:-1};for(let u=o.length-1;u>=0;u--){const m=o[u],b=m?.node;if(!(!b||!I.isStepNode(b))&&!(c&&m?.experienceId!==c))if(a.lastStepIndex===-1)a.lastStepIndex=u;else{a.secondLastStepIndex=u;break}}return a}return t.on(s,(o,c)=>{const{secondLastStepIndex:a}=p(o.entries,c.experienceId),u=a!==-1?o.entries.slice(0,a+1):o.entries;return{...o,entries:u}}),{push:e,replace:r,back:s,restore:n,entriesStore:t.map(o=>o.entries)}});function be(){return S.invoke(ke)}let we=0;const Ie=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},Fe=g.createDomain("field"),Ee=S.createFactory(()=>{const t=Fe.store({}),e=g.createApi(t,{register(a,u){return{...a,[u.resolvedKey]:{...u.field,key:u.resolvedKey}}}});function r(a){e.register({field:a,resolvedKey:a.key})}function s(a,u){const m=p(a).getState();if(!m)return;const b=Object.assign({},m,{...u});e.register({field:{...b},resolvedKey:a})}const n=t.map(a=>Object.values(a));function p(a){return t.map(u=>u[a]||null)}function o(a){return t.map(u=>Object.values(u).find(m=>m.id===a)||null)}function c(a){return t.map(u=>Object.values(u).find(m=>m.name===a)||null)}return{register:r,update:s,getByKey:p,getById:o,listStore:n,getByName:c}});function xe(){return S.invoke(Ee)}const je=(t,e)=>{e.register(t)},Ae=g.createDomain("action"),Pe=S.createFactory(()=>{const t=Ae.store({}),e=g.createApi(t,{register(o,c){return{...o,[c.name]:{name:c.name,action:c.action}}}});function r(o,c){e.register({name:o,action:c})}const s=t.map(o=>Object.values(o));function n(o){return t.map(c=>c[o],{skipVoid:!1})}function p(o){return t.map(c=>{const a=c[o];return a?a.action:void 0},{skipVoid:!1})}return{register:r,getByName:n,listStore:s,getEvokableAction:p}});function Re(){return S.invoke(Pe)}const Ce=(t,e,r)=>{r.register(t,e)};function C(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 ze=g.createDomain("response"),Be=S.createFactory(({client:t})=>{const e=ze.store({}),r=g.createEvent(),s=g.createEvent(),n=g.createApi(e,{register(y,i){return{...y,[i.fieldId]:i.response}},registerBatch(y,i){return{...y,...i}},clear(y,i){const{[i]:l,...f}=y;return f},clearAll(){return{}}});function p(y,i){if(typeof y=="string"){if(i===void 0)throw new Error("Response is required when registering a single field");n.register({fieldId:y,response:i})}else n.registerBatch(y)}async function o(y){const i=[];return await Promise.allSettled(Object.entries(y).map(async([l,f])=>{let d=f;const h=t.fields.getByKey(l).getState();if(!h){i.push({fieldId:l,userMessage:`Field '${l}' not found`,systemMessage:`No field with ID '${l}' exists. Available field IDs are: ${Object.keys(t.fields.listStore.getState()).join(",")}.`,value:d});return}if(h.multiple&&(typeof d=="string"||typeof d=="number"||typeof d=="boolean")&&(d=[d]),h.validation&&!G.isEmpty(h.validation)&&!C(d)){const v=await I.evaluateRuleLogic(t,h.validation,{$input:d});if(typeof v=="string"){i.push({fieldId:l,userMessage:v,systemMessage:`Field validation resulted in an error: ${v}.`,value:d});return}if(v===!1){i.push({fieldId:l,userMessage:"This field is invalid",systemMessage:"Field validation resulted in an unspecified error.",value:d});return}}if(h.required&&C(d)){i.push({fieldId:l,userMessage:"This field is required",systemMessage:"Field is required.",value:d});return}if(!h.multiple&&Array.isArray(d)&&d.length>1){i.push({fieldId:l,userMessage:"This field expects a single response",systemMessage:"Field expects a single response.",value:d});return}if(h.type==="object"&&!C(d))if(h.multiple){if(!Array.isArray(d)){i.push({fieldId:l,userMessage:"This field expects multiple values",systemMessage:"Field expects an array of objects.",value:d});return}for(const v of d){if(typeof v!="object"||v===null){i.push({fieldId:l,userMessage:"This field expects object values",systemMessage:"Field expects an array of objects, but received non-object value.",value:d});return}if(!M(v)){i.push({fieldId:l,userMessage:"This field contains non-serializable data",systemMessage:"Field value contains non-JSON-serializable data (functions, circular references, etc.).",value:d});return}}}else{if(Array.isArray(d)){i.push({fieldId:l,userMessage:"This field expects a single value",systemMessage:"Field expects a single object, not an array.",value:d});return}if(typeof d!="object"||d===null){i.push({fieldId:l,userMessage:"This field expects an object value",systemMessage:"Field expects an object value.",value:d});return}if(!M(d)){i.push({fieldId:l,userMessage:"This field contains non-serializable data",systemMessage:"Field value contains non-JSON-serializable data (functions, circular references, etc.).",value:d});return}}if(Array.isArray(h.options)&&h.options.length>0){const v=Array.isArray(d)?d:[d];if(h.type==="object"){const x=h.options.map(F=>JSON.stringify(F.value));v.every(F=>x.includes(JSON.stringify(F)))||i.push({fieldId:l,userMessage:"This field expects a valid option",systemMessage:"Field expects a valid option from the defined choices.",value:d})}else{const x=h.options.map(F=>F.value);v.every(F=>!$e(F)||F===null?!1:x.includes(F))||i.push({fieldId:l,userMessage:"This field expects a valid option",systemMessage:`Field expects a valid option. Valid options are: ${x.join(", ")}`,value:d})}}})),{responsesToCommit:y,validationErrors:i}}async function c(y){const{responsesToCommit:i,validationErrors:l}=await o(y);return l.length?{errors:l}:(n.registerBatch(i),{errors:[]})}const a=e.map(y=>y),u=e.map(y=>Object.keys(y).map(l=>({fieldId:l,value:y[l]})));function m(y){const i=t.fields.getByKey(y),l=e.map(f=>f[y]||null);return g.combine({f:i,r:l},({f,r:d})=>d||(f?.defaultValue?f.defaultValue:null))}function b(y){const i=t.fields.getByName(y);return g.combine({f:i,s:e},({f:l,s:f})=>{const d=l&&f[l.key??W.toKebabCase(l.name)]||null;return d||(l?.defaultValue?l.defaultValue:null)})}return g.sample({clock:r,target:n.clearAll}),g.sample({clock:s,target:n.clear}),{register:p,clearAll:r,clear:s,commit:c,getResponsesToCommit:o,listStore:u,getAllStore:a,getByFieldId:m,getByFieldName:b}});function De(t){return S.invoke(Be,t)}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[n]of t.entries())n.startsWith("picked-")&&r.add(n);for(const n of r){const p=n.replace("picked-","");e[p]=t.getAll(n)}const s=w.createStorageKey("s");if(r.size>0)w.sessionStore.set(s,e);else{const n=w.sessionStore.get(s);if(n)return n.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=n=>t.set({id:n.id,isUser:n.isUser,identifiers:n.identifiers}),s={id:e?.id??Ue(),isUser:e?.isUser??void 0,identifiers:e?.identifiers??void 0,setIsUser(n){this.isUser=n,r(this)},setIdentifier(n,p){this.identifiers={...this.identifiers,[n]:p},r(this)},removeIdentifier(n){this.identifiers&&(this.identifiers=Object.fromEntries(Object.entries(this.identifiers).filter(([p])=>p!==n)),this.identifiers=Object.keys(this.identifiers).length?this.identifiers:void 0,r(this))}};return r(s),s},Ne=()=>k.supportsLocalStorage()?Ve():null;function T(){if(k.supportsWindow())return globalThis.window.pickedConfig}function Te(){if(!k.supportsWindow())return;const t=T(),e=t?.organizationId,r=t?.projectId;return e&&r?{organizationId:e,projectId:r}:void 0}function Ke(){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 _e(t){const{organizationId:e,projectId:r}=t;if(e&&r)return{organizationId:e,projectId:r};const s=Te();if(s)return s;const n=Ke();if(n)return n;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 qe={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,n])=>`${s}: ${n}`);return e.format(r)}return t instanceof Set?e.format(Array.from(t).map(String)):t}};function He(t){return typeof t=="object"&&t!==null}function Ge(t,e){let r=e;for(const s of t.split("."))if(He(r)&&s in r)r=r[s];else return;return typeof r=="function"?r():r}function We(t,e){const r=t.split("|").map(p=>p.trim()),s=r.shift()??"";let n=Ge(s,e);for(const p of r){const[o,...c]=p.split(":"),a=o?.trim()??"",u=c.join(":").trim().replaceAll(/(?:^['"]|['"]$)/g,""),m=qe[a];m&&(n=m(n,u))}return R(n)?"":typeof n=="object"?JSON.stringify(n):String(n)}function Je(t,e){let r="",s=0;for(;s<t.length;)if(t[s]==="{"&&t[s+1]==="{"){s+=2;let n="";for(;s<t.length;){if(t[s]==="}"&&t[s+1]==="}"){s+=2;break}n+=t[s++]}r+=We(n.trim(),e)}else r+=t[s++];return r}class K{static logger=E.logger;options;isReady=!1;project;plugins={};pluginStartHooks=[];eventBus=g.createEvent();events;organizationId;projectId;apiUrl;dashboardUrl;documentationSiteUrl;session;precondition;condition;preconditionPassed;searchParams=Me();history=be();components=ie({client:this});experienceInstances=I.createExperienceInstanceIndex({client:this});experiences=X({client:this});frameworks=ce({client:this});predicates=me({client:this});features=Se({client:this});responses=De({client:this});fields=xe();actions=Re();constructor(e){E.logger("info","Picked client initializing."),this.events=Ie(this.eventBus);const{organizationId:r,projectId:s}=_e(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=Ne(),this.setupPlugins(),this.setupFeatures(),this.setupPredicates(),this.setupActions(),this.setupComponents(),this.precondition=e.precondition,this.condition=e.condition,this.eventBus({type:"load",version:U.getVersion()}),E.logger("info","Picked client initialized.")}start=()=>{pe(this),(async()=>{if(!k.supportsDocument())return;await this.runPluginStartHooks();const r=await this.evaluateGate(this.precondition);this.preconditionPassed=r;let s;r&&(s=await this.evaluateGate(this.condition));const n=r&&s===!0;if(typeof s=="boolean"&&this.session){const p=s;this.session.setIsUser(p),this.eventBus({type:"user_decide",value:p})}if(this.eventBus({type:"initialize"}),n&&z(this),await I.domInteractive(),n&&z(this),this.eventBus({type:"ready"}),this.isReady=!0,this.session){const{id:p,isUser:o,identifiers:c}=this.session;this.eventBus({type:"session",id:p,isUser:o,identifiers:c})}})()};registerFramework=e=>{ue(e,this.frameworks)};registerComponent=(e,r)=>{B(e,r,this.components)};registerPlugin=e=>{ee(this,e,this.plugins);const r=this.plugins[e.name];r?.onStart&&this.pluginStartHooks.push(r.onStart)};registerFeature=(e,r)=>{ve(e,r,this.features)};registerPredicate=(e,r)=>{ye(e,r,this.predicates)};registerField=e=>{je(e,this.fields)};registerAction=(e,r)=>{Ce(e,r,this.actions)};registerExperience=e=>{e.component&&B(`experience:${e.id}`,e.component,this.components),Z(e,this.experiences)};getStateSnapshot=()=>N(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 n=typeof s=="function"?s():s;this.registerFeature(r,n)}),this.searchParams.feature&&this.searchParams.feature.forEach(r=>{try{const[s,n]=r.split(":");if(!s||!n)return;let p=n;p==="true"&&(p=!0),p==="false"&&(p=!1),this.registerFeature(s,{key:`${p}`,name:s,decide:()=>p,storage:"session"})}catch{}}))}setupPredicates(){const e=this.options.predicates;e&&Object.entries(e).forEach(([r,s])=>{if(typeof s!="function"){E.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"){E.logger("warn",`Action "${r}" is not a function.`);return}this.registerAction(r,s)})}setupComponents(){const e=this.options.components;e&&Object.entries(e).forEach(([r,s])=>{this.registerComponent(r,s)})}getPluginConfig=e=>this.plugins[e]??{};renderString=(e,r)=>{const s=this.responses.listStore.getState().reduce((n,p)=>(n[p.fieldId]=p.value,n),{});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 o=(await Promise.all(s.options.map(async a=>a.condition?await I.evaluateRuleLogic(t,a.condition)?a:null:a))).filter(a=>a!==null);return o.length===s.options.length?s:o.length===0?null:{...s,options:o}}))).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 K(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=K;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 p=require("../../../id-BKIWbSTy.cjs"),g=require("../../../to-kebab-case-BsOQ8CON.cjs"),r={serialize(i){return JSON.stringify(i)},deserialize(i){return JSON.parse(i)}},y=i=>({name:"create-experience",setup:d=>{i.experiences.forEach(t=>{const s=t.serialize(),o=r.deserialize(s);o.component=t.component,d.registerExperience(o),o.fields.forEach(f=>{d.registerField(f)})})}}),z=(i,d)=>({id:p.generateId("node"),experience:d,type:"action",action:i.action,addNext(s){if(!s.node)throw new Error("Cannot connect to node");const o=c({sourceNode:this,destinationNode:s.node,sourceNodeHandle:null},d);d.edges.push(o)},onSuccess(s){if(!s.node)throw new Error("Cannot connect to node");const o=c({sourceNode:this,destinationNode:s.node,sourceNodeHandle:"true"},d);d.edges.push(o)},onFail(s){if(!s.node)throw new Error("Cannot connect to node");const o=c({sourceNode:this,destinationNode:s.node,sourceNodeHandle:"false"},d);d.edges.push(o)},serialize(){return r.serialize({id:this.id,type:this.type,action:this.action})}}),b=i=>({id:i.id??p.generateId("step"),name:i.name,fields:i.fields??[],addField(d){const t="serialize"in d?d:m(d);return this.fields.includes(t)||this.fields.push(t),t}}),v=(i,d)=>{const t={id:i.id??p.generateId("step"),name:i.name,experience:d,fields:i.fields??[],node:null,nextStep(s){return this.experience.addStep(s,this)},nextConditional(s){return this.experience.addConditional(s,this)},addNextExperience(s){return this.experience.addExperience(s,this)},addField(s){return this.experience.addField(s,this)},serialize(){return r.serialize({id:this.id,key:g.toKebabCase(this.name),name:this.name,fieldIds:this.fields.map(s=>s.id)})}};return h({step:t,type:"step"},d),t},h=(i,d)=>{const t={id:p.generateId("node"),experience:d};if(i.type==="step"){const o={...t,type:"step",connectedStep:i.step,serialize(){return r.serialize({id:this.id,type:this.type,stepId:this.connectedStep.id,name:this.connectedStep.name})}};return o.connectedStep.node=o,o}if(i.type==="conditional"){const o={...t,type:"conditional",connectedConditional:i.conditional,serialize(){return r.serialize({id:this.id,type:this.type,conditionalId:this.connectedConditional.id})}};return o.connectedConditional.node=o,o}return i.type==="experience"?{...t,type:"experience",connectedExperience:i.experience,serialize(){return r.serialize({id:this.id,type:this.type,experienceId:this.connectedExperience.id})}}:{...t,type:"origin",serialize(){return r.serialize({id:this.id,type:this.type})}}},c=(i,d)=>({id:p.generateId("edge"),sourceNode:i.sourceNode,sourceNodeHandle:i.sourceNodeHandle,destinationNode:i.destinationNode,experience:d,serialize(){return r.serialize({id:this.id,sourceNodeHandle:this.sourceNodeHandle??void 0,sourceNodeId:this.sourceNode.id,destinationNodeId:this.destinationNode.id})}}),N=(i,d)=>{const t={id:p.generateId("conditional"),label:i.label,condition:i.condition,node:null,experience:d,addTrue(s){if(!this.node||!s.node)throw new Error("todo no node");const o=c({sourceNode:this.node,destinationNode:s.node,sourceNodeHandle:"true"},this.experience);this.experience.edges.push(o)},addFalse(s){if(!this.node||!s.node)throw new Error("todo no node");const o=c({sourceNode:this.node,destinationNode:s.node,sourceNodeHandle:"false"},this.experience);this.experience.edges.push(o)},serialize(){return r.serialize({id:this.id,label:this.label,condition:this.condition})}};return h({conditional:t,type:"conditional"},d),t},m=i=>({id:i.id??p.generateId("field"),key:i.key??g.toKebabCase(i.name),name:i.name,type:i.type,label:i.label,placeholder:i.placeholder,description:i.description,helpText:i.helpText,defaultValue:i.defaultValue??null,multiple:i.multiple,validation:i.validation??{},condition:i.condition,required:i.required,options:i.options?.map(t=>({id:"id"in t?t.id:p.generateId("option"),...t}))??null,policies:i.policies,serialize(){const t={id:this.id,key:this.key,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},s=typeof this.defaultValue=="string"?this.defaultValue:void 0,o=typeof this.defaultValue=="number"?this.defaultValue:void 0,f=typeof this.defaultValue=="boolean"?this.defaultValue:void 0;switch(this.type){case"text":if(this.multiple){let e;if(Array.isArray(this.defaultValue)){e=[];for(const n of this.defaultValue)typeof n=="string"&&e.push(n);e.length===0&&(e=void 0)}return r.serialize({...t,type:"text",multiple:!0,defaultValue:e,options:this.options?this.options.map(n=>({id:n.id,label:n.label,value:`${n.value}`,condition:n.condition})):null})}return r.serialize({...t,type:"text",multiple:!1,defaultValue:s,options:this.options?this.options.map(e=>({id:e.id,label:e.label,value:`${e.value}`,condition:e.condition})):null});case"number":if(this.multiple){let e;if(Array.isArray(this.defaultValue)){e=[];for(const n of this.defaultValue)typeof n=="number"&&e.push(n);e.length===0&&(e=void 0)}return r.serialize({...t,type:"number",multiple:!0,defaultValue:e,options:this.options?this.options.map(n=>({id:n.id,label:n.label,value:Number(n.value),condition:n.condition})):null})}return r.serialize({...t,type:"number",multiple:!1,defaultValue:o,options:this.options?this.options.map(e=>({id:e.id,label:e.label,value:Number(e.value),condition:e.condition})):null});case"boolean":if(this.multiple){let e;if(Array.isArray(this.defaultValue)){e=[];for(const n of this.defaultValue)typeof n=="boolean"&&e.push(n);e.length===0&&(e=void 0)}return r.serialize({...t,type:"boolean",multiple:!0,defaultValue:e,options:this.options?this.options.map(n=>({id:n.id,label:n.label,value:!!n.value,condition:n.condition})):null})}return r.serialize({...t,type:"boolean",multiple:!1,defaultValue:f,options:this.options?this.options.map(e=>({id:e.id,label:e.label,value:!!e.value,condition:e.condition})):null});case"object":return this.multiple?r.serialize({...t,type:"object",multiple:!0,defaultValue:this.defaultValue,options:this.options?this.options.map(e=>({id:e.id,label:e.label,description:e.description,value:e.value,condition:e.condition})):null}):r.serialize({...t,type:"object",multiple:!1,defaultValue:this.defaultValue,options:this.options?this.options.map(e=>({id:e.id,label:e.label,description:e.description,value:e.value,condition:e.condition})):null});default:throw new Error("Unsupported field type")}}}),x=i=>{const d=[],t=[],s=[],o=[],f=[];return{id:i.id,component:i.component,name:i.name,initializeOpen:i.initializeOpen,condition:i.condition,targets:i.targets,steps:d,nodes:t,edges:s,fields:f,conditionals:o,addStep(e,n){let a=n?.node;this.nodes.length===0&&(a=h({type:"origin"},this),this.nodes.push(a));const l="serialize"in e?e:v(e,this);if(a){if(!l.node)throw new Error("todo no node");const u=c({sourceNode:a,destinationNode:l.node,sourceNodeHandle:null},this);this.edges.push(u)}return l.fields.length>0&&l.fields.forEach(u=>{this.fields.includes(u)||this.fields.push(u)}),this.steps.includes(l)||(this.steps.push(l),l.node&&this.nodes.push(l.node)),l},addAction(e,n){let a=n?.node;this.nodes.length===0&&(a=h({type:"origin"},this),this.nodes.push(a));const l="serialize"in e?e:z(e,this);if(a){const u=c({sourceNode:a,destinationNode:l,sourceNodeHandle:null},this);this.edges.push(u)}return this.nodes.push(l),l},addConditional(e,n){let a=n?.node;this.nodes.length===0&&(a=h({type:"origin"},this),this.nodes.push(a));const l="serialize"in e?e:N(e,this);if(a){if(!l.node)throw new Error("todo no node");const u=c({sourceNode:a,destinationNode:l.node,sourceNodeHandle:null},this);this.edges.push(u)}return this.conditionals.includes(l)||(this.conditionals.push(l),l.node&&this.nodes.push(l.node)),l},addExperience(e,n){let a=n?.node;this.nodes.length===0&&(a=h({type:"origin"},this),this.nodes.push(a));const l=h({type:"experience",experience:e},this);if(this.nodes.push(l),a){const u=c({sourceNode:a,destinationNode:l,sourceNodeHandle:null},this);this.edges.push(u)}return e},addField(e,n){const a="serialize"in e?e:m(e);return n&&n.fields.push(a),this.fields.includes(a)||this.fields.push(a),a},serialize(){return r.serialize({id:this.id,component:this.component,name:this.name,initializeOpen:this.initializeOpen,condition:this.condition,targets:this.targets,steps:this.steps.map(e=>r.deserialize(e.serialize())),nodes:this.nodes.map(e=>r.deserialize(e.serialize())),edges:this.edges.map(e=>r.deserialize(e.serialize())),conditionals:this.conditionals.map(e=>r.deserialize(e.serialize())),fields:this.fields.map(e=>r.deserialize(e.serialize()))})}}};exports.createConditional=N;exports.createEdge=c;exports.createExperience=x;exports.createExperiencePlugin=y;exports.createField=m;exports.createNode=h;exports.createStep=b;exports.serialization=r;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("../../../id-BKIWbSTy.cjs"),m=require("../../../to-kebab-case-BsOQ8CON.cjs"),r={serialize(i){return JSON.stringify(i)},deserialize(i){return JSON.parse(i)}},N=i=>({name:"create-experience",setup:o=>{i.experiences.forEach(t=>{const s=t.serialize(),a=r.deserialize(s);a.component=t.component,o.registerExperience(a),a.fields.forEach(f=>{o.registerField(f)})})}}),b=(i,o)=>({id:h.generateId("node"),experience:o,type:"action",action:i.action,addNext(s){if(!s.node)throw new Error("Cannot connect to node");const a=c({sourceNode:this,destinationNode:s.node,sourceNodeHandle:null},o);o.edges.push(a)},onSuccess(s){if(!s.node)throw new Error("Cannot connect to node");const a=c({sourceNode:this,destinationNode:s.node,sourceNodeHandle:"true"},o);o.edges.push(a)},onFail(s){if(!s.node)throw new Error("Cannot connect to node");const a=c({sourceNode:this,destinationNode:s.node,sourceNodeHandle:"false"},o);o.edges.push(a)},serialize(){return r.serialize({id:this.id,type:this.type,action:this.action})}}),z=i=>({id:i.id??h.generateId("step"),key:i.key??m.toKebabCase(i.name),name:i.name,fields:i.fields??[],addField(o){const t="serialize"in o?o:y(o);return this.fields.includes(t)||this.fields.push(t),t}}),v=(i,o)=>{const t={id:i.id??h.generateId("step"),key:i.key??m.toKebabCase(i.name),name:i.name,experience:o,fields:i.fields??[],node:null,nextStep(s){return this.experience.addStep(s,this)},nextConditional(s){return this.experience.addConditional(s,this)},addNextExperience(s){return this.experience.addExperience(s,this)},addField(s){return this.experience.addField(s,this)},serialize(){return r.serialize({id:this.id,key:m.toKebabCase(this.name),name:this.name,fieldIds:this.fields.map(s=>s.id)})}};return p({step:t,type:"step"},o),t},p=(i,o)=>{const t={id:h.generateId("node"),experience:o};if(i.type==="step"){const a={...t,type:"step",connectedStep:i.step,serialize(){return r.serialize({id:this.id,type:this.type,stepId:this.connectedStep.id,name:this.connectedStep.name})}};return a.connectedStep.node=a,a}if(i.type==="conditional"){const a={...t,type:"conditional",connectedConditional:i.conditional,serialize(){return r.serialize({id:this.id,type:this.type,conditionalId:this.connectedConditional.id})}};return a.connectedConditional.node=a,a}return i.type==="experience"?{...t,type:"experience",connectedExperience:i.experience,serialize(){return r.serialize({id:this.id,type:this.type,experienceId:this.connectedExperience.id})}}:{...t,type:"origin",serialize(){return r.serialize({id:this.id,type:this.type})}}},c=(i,o)=>({id:h.generateId("edge"),sourceNode:i.sourceNode,sourceNodeHandle:i.sourceNodeHandle,destinationNode:i.destinationNode,experience:o,serialize(){return r.serialize({id:this.id,sourceNodeHandle:this.sourceNodeHandle??void 0,sourceNodeId:this.sourceNode.id,destinationNodeId:this.destinationNode.id})}}),g=(i,o)=>{const t={id:h.generateId("conditional"),label:i.label,condition:i.condition,node:null,experience:o,addTrue(s){if(!this.node||!s.node)throw new Error("todo no node");const a=c({sourceNode:this.node,destinationNode:s.node,sourceNodeHandle:"true"},this.experience);this.experience.edges.push(a)},addFalse(s){if(!this.node||!s.node)throw new Error("todo no node");const a=c({sourceNode:this.node,destinationNode:s.node,sourceNodeHandle:"false"},this.experience);this.experience.edges.push(a)},serialize(){return r.serialize({id:this.id,label:this.label,condition:this.condition})}};return p({conditional:t,type:"conditional"},o),t},y=i=>({id:i.id??h.generateId("field"),key:i.key??m.toKebabCase(i.name),name:i.name,type:i.type,label:i.label,placeholder:i.placeholder,description:i.description,helpText:i.helpText,defaultValue:i.defaultValue??null,multiple:i.multiple,validation:i.validation??{},condition:i.condition,required:i.required,options:i.options?.map(t=>({id:"id"in t?t.id:h.generateId("option"),...t}))??null,policies:i.policies,serialize(){const t={id:this.id,key:this.key,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},s=typeof this.defaultValue=="string"?this.defaultValue:void 0,a=typeof this.defaultValue=="number"?this.defaultValue:void 0,f=typeof this.defaultValue=="boolean"?this.defaultValue:void 0;switch(this.type){case"text":if(this.multiple){let e;if(Array.isArray(this.defaultValue)){e=[];for(const n of this.defaultValue)typeof n=="string"&&e.push(n);e.length===0&&(e=void 0)}return r.serialize({...t,type:"text",multiple:!0,defaultValue:e,options:this.options?this.options.map(n=>({id:n.id,label:n.label,value:`${n.value}`,condition:n.condition})):null})}return r.serialize({...t,type:"text",multiple:!1,defaultValue:s,options:this.options?this.options.map(e=>({id:e.id,label:e.label,value:`${e.value}`,condition:e.condition})):null});case"number":if(this.multiple){let e;if(Array.isArray(this.defaultValue)){e=[];for(const n of this.defaultValue)typeof n=="number"&&e.push(n);e.length===0&&(e=void 0)}return r.serialize({...t,type:"number",multiple:!0,defaultValue:e,options:this.options?this.options.map(n=>({id:n.id,label:n.label,value:Number(n.value),condition:n.condition})):null})}return r.serialize({...t,type:"number",multiple:!1,defaultValue:a,options:this.options?this.options.map(e=>({id:e.id,label:e.label,value:Number(e.value),condition:e.condition})):null});case"boolean":if(this.multiple){let e;if(Array.isArray(this.defaultValue)){e=[];for(const n of this.defaultValue)typeof n=="boolean"&&e.push(n);e.length===0&&(e=void 0)}return r.serialize({...t,type:"boolean",multiple:!0,defaultValue:e,options:this.options?this.options.map(n=>({id:n.id,label:n.label,value:!!n.value,condition:n.condition})):null})}return r.serialize({...t,type:"boolean",multiple:!1,defaultValue:f,options:this.options?this.options.map(e=>({id:e.id,label:e.label,value:!!e.value,condition:e.condition})):null});case"object":return this.multiple?r.serialize({...t,type:"object",multiple:!0,defaultValue:this.defaultValue,options:this.options?this.options.map(e=>({id:e.id,label:e.label,description:e.description,value:e.value,condition:e.condition})):null}):r.serialize({...t,type:"object",multiple:!1,defaultValue:this.defaultValue,options:this.options?this.options.map(e=>({id:e.id,label:e.label,description:e.description,value:e.value,condition:e.condition})):null});default:throw new Error("Unsupported field type")}}}),x=i=>{const o=[],t=[],s=[],a=[],f=[];return{id:i.id,component:i.component,name:i.name,initializeOpen:i.initializeOpen,condition:i.condition,targets:i.targets,steps:o,nodes:t,edges:s,fields:f,conditionals:a,addStep(e,n){let l=n?.node;this.nodes.length===0&&(l=p({type:"origin"},this),this.nodes.push(l));let d="serialize"in e?e:v(e,this);if(d={...d,id:d.id??h.generateId("step"),key:d.key??m.toKebabCase(d.name)},l){if(!d.node)throw new Error("todo no node");const u=c({sourceNode:l,destinationNode:d.node,sourceNodeHandle:null},this);this.edges.push(u)}return d.fields.length>0&&d.fields.forEach(u=>{this.fields.includes(u)||this.fields.push(u)}),this.steps.includes(d)||(this.steps.push(d),d.node&&this.nodes.push(d.node)),d},addAction(e,n){let l=n?.node;this.nodes.length===0&&(l=p({type:"origin"},this),this.nodes.push(l));const d="serialize"in e?e:b(e,this);if(l){const u=c({sourceNode:l,destinationNode:d,sourceNodeHandle:null},this);this.edges.push(u)}return this.nodes.push(d),d},addConditional(e,n){let l=n?.node;this.nodes.length===0&&(l=p({type:"origin"},this),this.nodes.push(l));const d="serialize"in e?e:g(e,this);if(l){if(!d.node)throw new Error("todo no node");const u=c({sourceNode:l,destinationNode:d.node,sourceNodeHandle:null},this);this.edges.push(u)}return this.conditionals.includes(d)||(this.conditionals.push(d),d.node&&this.nodes.push(d.node)),d},addExperience(e,n){let l=n?.node;this.nodes.length===0&&(l=p({type:"origin"},this),this.nodes.push(l));const d=p({type:"experience",experience:e},this);if(this.nodes.push(d),l){const u=c({sourceNode:l,destinationNode:d,sourceNodeHandle:null},this);this.edges.push(u)}return e},addField(e,n){const l="serialize"in e?e:y(e);return n&&n.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,targets:this.targets,steps:this.steps.map(e=>r.deserialize(e.serialize())),nodes:this.nodes.map(e=>r.deserialize(e.serialize())),edges:this.edges.map(e=>r.deserialize(e.serialize())),conditionals:this.conditionals.map(e=>r.deserialize(e.serialize())),fields:this.fields.map(e=>r.deserialize(e.serialize()))})}}};exports.createConditional=g;exports.createEdge=c;exports.createExperience=x;exports.createExperiencePlugin=N;exports.createField=y;exports.createNode=p;exports.createStep=z;exports.serialization=r;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("../../../api-C7ddxkUx.cjs"),a=require("../../../logger-BsmHUUw1.cjs");function g(e){let r=2166136261;for(let n=0;n<e.length;n++)r^=e.charCodeAt(n),r=Math.imul(r,16777619);return r>>>0}function d(e){return g(e)%100}function p(e,r){return r<=0?!1:r>=100?!0:e<r}function h(e){return typeof e!="object"||e===null||!("key"in e&&"name"in e&&"enabled"in e&&"weight"in e&&"version"in e)?!1:typeof e.key=="string"&&typeof e.name=="string"&&typeof e.enabled=="boolean"&&typeof e.weight=="number"&&typeof e.version=="number"}function l(e){return typeof e!="object"||e===null||!("features"in e)||!Array.isArray(e.features)?!1:e.features.every(h)}function y(e){const r=e.searchParams["preview-token"];if(r&&r.length>0)return r[0]}function m(e){const r=new Set,n=e.searchParams.feature;if(!n)return r;for(const o of n){const t=o.indexOf(":");t>0&&r.add(o.substring(0,t))}return r}function c(e,r,n){const o=m(e),t=e.session?.id;if(!t)throw new Error("Session ID is required for feature registration");const i=d(t);for(const s of r.features)o.has(s.key)||v(e,s,n,i)}function v(e,r,n,o){e.registerFeature(r.key,{key:`v${r.version}`,name:r.name,storage:n?"session":"local",decide:()=>r.enabled?p(o,r.weight):!1})}function w(){let e;try{e=__PICKED_PROJECT_CONFIG__}catch{return}if(e===void 0)return;let r;if(typeof e=="string")try{r=JSON.parse(e)}catch{a.logger("warn","Build-time project config is not valid JSON");return}else r=e;if(l(r))return r;a.logger("warn","Build-time project config has invalid shape, falling back to runtime fetch")}function j(e){try{const r=new URL(e).hostname;return r==="localhost"||r==="127.0.0.1"||r==="::1"}catch{return!1}}function b(e){if(typeof e!="object"||e===null||!("cause"in e))return!1;const{cause:r}=e;return typeof r!="object"||r===null||!("code"in r)?!1:r.code==="ECONNREFUSED"}async function u(e,r,n){const o=n?.previewToken?`projects/${r}?preview_token=${encodeURIComponent(n.previewToken)}`:`projects/${r}`;let t;try{t=await f.get(e,o,n?.headers)}catch(s){return j(e)&&b(s)||a.logger("warn","Failed to fetch project config",s),null}if(!t.ok)return a.logger("warn",`Project config request failed with status ${t.status.toString()}`),null;let i;try{i=await t.json()}catch{return a.logger("warn","Failed to parse project config response"),null}return l(i)?i:(a.logger("warn","Invalid project config response shape"),null)}function P(e){return{name:"dynamic-experiences",setup:r=>{const n=e?.apiUrl??r.apiUrl;return{onStart:async()=>{const o=y(r);if(o){const s=await u(n,r.projectId,{previewToken:o});s&&c(r,s,!0);return}const t=e?.projectConfig??w();if(t){c(r,t,!1);return}const i=await u(n,r.projectId);i&&c(r,i,!1)}}}}}exports.createClientHeaders=f.createClientHeaders;exports.dynamicExperiencesPlugin=P;exports.fetchProject=u;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("../../../api-F0IOGUor.cjs"),a=require("../../../logger-BsmHUUw1.cjs");function g(e){let r=2166136261;for(let n=0;n<e.length;n++)r^=e.charCodeAt(n),r=Math.imul(r,16777619);return r>>>0}function d(e){return g(e)%100}function p(e,r){return r<=0?!1:r>=100?!0:e<r}function h(e){return typeof e!="object"||e===null||!("key"in e&&"name"in e&&"enabled"in e&&"weight"in e&&"version"in e)?!1:typeof e.key=="string"&&typeof e.name=="string"&&typeof e.enabled=="boolean"&&typeof e.weight=="number"&&typeof e.version=="number"}function l(e){return typeof e!="object"||e===null||!("features"in e)||!Array.isArray(e.features)?!1:e.features.every(h)}function y(e){const r=e.searchParams["preview-token"];if(r&&r.length>0)return r[0]}function m(e){const r=new Set,n=e.searchParams.feature;if(!n)return r;for(const o of n){const t=o.indexOf(":");t>0&&r.add(o.substring(0,t))}return r}function c(e,r,n){const o=m(e),t=e.session?.id;if(!t)throw new Error("Session ID is required for feature registration");const i=d(t);for(const s of r.features)o.has(s.key)||v(e,s,n,i)}function v(e,r,n,o){e.registerFeature(r.key,{key:`v${r.version}`,name:r.name,storage:n?"session":"local",decide:()=>r.enabled?p(o,r.weight):!1})}function w(){let e;try{e=__PICKED_PROJECT_CONFIG__}catch{return}if(e===void 0)return;let r;if(typeof e=="string")try{r=JSON.parse(e)}catch{a.logger("warn","Build-time project config is not valid JSON");return}else r=e;if(l(r))return r;a.logger("warn","Build-time project config has invalid shape, falling back to runtime fetch")}function j(e){try{const r=new URL(e).hostname;return r==="localhost"||r==="127.0.0.1"||r==="::1"}catch{return!1}}function b(e){if(typeof e!="object"||e===null||!("cause"in e))return!1;const{cause:r}=e;return typeof r!="object"||r===null||!("code"in r)?!1:r.code==="ECONNREFUSED"}async function u(e,r,n){const o=n?.previewToken?`projects/${r}?preview_token=${encodeURIComponent(n.previewToken)}`:`projects/${r}`;let t;try{t=await f.get(e,o,n?.headers)}catch(s){return j(e)&&b(s)||a.logger("warn","Failed to fetch project config",s),null}if(!t.ok)return a.logger("warn",`Project config request failed with status ${t.status.toString()}`),null;let i;try{i=await t.json()}catch{return a.logger("warn","Failed to parse project config response"),null}return l(i)?i:(a.logger("warn","Invalid project config response shape"),null)}function P(e){return{name:"dynamic-experiences",setup:r=>{const n=e?.apiUrl??r.apiUrl;return{onStart:async()=>{const o=y(r);if(o){const s=await u(n,r.projectId,{previewToken:o});s&&c(r,s,!0);return}const t=e?.projectConfig??w();if(t){c(r,t,!1);return}const i=await u(n,r.projectId);i&&c(r,i,!1)}}}}}exports.createClientHeaders=f.createClientHeaders;exports.dynamicExperiencesPlugin=P;exports.fetchProject=u;
package/dist/esm/index.js CHANGED
@@ -5,7 +5,7 @@ import { f as Ot } from "../experience-instance-fvSEb72i.js";
5
5
  import { l as w } from "../logger-C9a75KZn.js";
6
6
  import { c as A, l as C, s as O } from "../storage-Co_LbKr_.js";
7
7
  import { a as Ut } from "../storage-Co_LbKr_.js";
8
- import { p as ae, g as ce } from "../api-CQ_YBH_c.js";
8
+ import { p as ae, g as ce } from "../api-B3JRgxph.js";
9
9
  import { g as ue } from "../id-BW-g3y32.js";
10
10
  import { i as de } from "../object-JwZ58NOH.js";
11
11
  import { t as le } from "../to-kebab-case-BPnCZjhB.js";
@@ -11,40 +11,40 @@ const r = {
11
11
  name: "create-experience",
12
12
  setup: (o) => {
13
13
  i.experiences.forEach((t) => {
14
- const n = t.serialize(), d = r.deserialize(n);
15
- d.component = t.component, o.registerExperience(d), d.fields.forEach((f) => {
14
+ const s = t.serialize(), l = r.deserialize(s);
15
+ l.component = t.component, o.registerExperience(l), l.fields.forEach((f) => {
16
16
  o.registerField(f);
17
17
  });
18
18
  });
19
19
  }
20
- }), y = (i, o) => ({
20
+ }), N = (i, o) => ({
21
21
  id: h("node"),
22
22
  experience: o,
23
23
  type: "action",
24
24
  action: i.action,
25
- addNext(n) {
26
- if (!n.node) throw new Error("Cannot connect to node");
27
- const d = c(
28
- { sourceNode: this, destinationNode: n.node, sourceNodeHandle: null },
25
+ addNext(s) {
26
+ if (!s.node) throw new Error("Cannot connect to node");
27
+ const l = c(
28
+ { sourceNode: this, destinationNode: s.node, sourceNodeHandle: null },
29
29
  o
30
30
  );
31
- o.edges.push(d);
31
+ o.edges.push(l);
32
32
  },
33
- onSuccess(n) {
34
- if (!n.node) throw new Error("Cannot connect to node");
35
- const d = c(
36
- { sourceNode: this, destinationNode: n.node, sourceNodeHandle: "true" },
33
+ onSuccess(s) {
34
+ if (!s.node) throw new Error("Cannot connect to node");
35
+ const l = c(
36
+ { sourceNode: this, destinationNode: s.node, sourceNodeHandle: "true" },
37
37
  o
38
38
  );
39
- o.edges.push(d);
39
+ o.edges.push(l);
40
40
  },
41
- onFail(n) {
42
- if (!n.node) throw new Error("Cannot connect to node");
43
- const d = c(
44
- { sourceNode: this, destinationNode: n.node, sourceNodeHandle: "false" },
41
+ onFail(s) {
42
+ if (!s.node) throw new Error("Cannot connect to node");
43
+ const l = c(
44
+ { sourceNode: this, destinationNode: s.node, sourceNodeHandle: "false" },
45
45
  o
46
46
  );
47
- o.edges.push(d);
47
+ o.edges.push(l);
48
48
  },
49
49
  serialize() {
50
50
  return r.serialize({
@@ -55,37 +55,39 @@ const r = {
55
55
  }
56
56
  }), V = (i) => ({
57
57
  id: i.id ?? h("step"),
58
+ key: i.key ?? m(i.name),
58
59
  name: i.name,
59
60
  fields: i.fields ?? [],
60
61
  addField(o) {
61
- const t = "serialize" in o ? o : N(o);
62
+ const t = "serialize" in o ? o : y(o);
62
63
  return this.fields.includes(t) || this.fields.push(t), t;
63
64
  }
64
65
  }), z = (i, o) => {
65
66
  const t = {
66
67
  id: i.id ?? h("step"),
68
+ key: i.key ?? m(i.name),
67
69
  name: i.name,
68
70
  experience: o,
69
71
  fields: i.fields ?? [],
70
72
  node: null,
71
- nextStep(n) {
72
- return this.experience.addStep(n, this);
73
+ nextStep(s) {
74
+ return this.experience.addStep(s, this);
73
75
  },
74
- nextConditional(n) {
75
- return this.experience.addConditional(n, this);
76
+ nextConditional(s) {
77
+ return this.experience.addConditional(s, this);
76
78
  },
77
- addNextExperience(n) {
78
- return this.experience.addExperience(n, this);
79
+ addNextExperience(s) {
80
+ return this.experience.addExperience(s, this);
79
81
  },
80
- addField(n) {
81
- return this.experience.addField(n, this);
82
+ addField(s) {
83
+ return this.experience.addField(s, this);
82
84
  },
83
85
  serialize() {
84
86
  return r.serialize({
85
87
  id: this.id,
86
88
  key: m(this.name),
87
89
  name: this.name,
88
- fieldIds: this.fields.map((n) => n.id)
90
+ fieldIds: this.fields.map((s) => s.id)
89
91
  });
90
92
  }
91
93
  };
@@ -96,7 +98,7 @@ const r = {
96
98
  experience: o
97
99
  };
98
100
  if (i.type === "step") {
99
- const d = {
101
+ const l = {
100
102
  ...t,
101
103
  type: "step",
102
104
  connectedStep: i.step,
@@ -109,10 +111,10 @@ const r = {
109
111
  });
110
112
  }
111
113
  };
112
- return d.connectedStep.node = d, d;
114
+ return l.connectedStep.node = l, l;
113
115
  }
114
116
  if (i.type === "conditional") {
115
- const d = {
117
+ const l = {
116
118
  ...t,
117
119
  type: "conditional",
118
120
  connectedConditional: i.conditional,
@@ -124,7 +126,7 @@ const r = {
124
126
  });
125
127
  }
126
128
  };
127
- return d.connectedConditional.node = d, d;
129
+ return l.connectedConditional.node = l, l;
128
130
  }
129
131
  return i.type === "experience" ? {
130
132
  ...t,
@@ -168,23 +170,23 @@ const r = {
168
170
  condition: i.condition,
169
171
  node: null,
170
172
  experience: o,
171
- addTrue(n) {
172
- if (!this.node || !n.node)
173
+ addTrue(s) {
174
+ if (!this.node || !s.node)
173
175
  throw new Error("todo no node");
174
- const d = c(
175
- { sourceNode: this.node, destinationNode: n.node, sourceNodeHandle: "true" },
176
+ const l = c(
177
+ { sourceNode: this.node, destinationNode: s.node, sourceNodeHandle: "true" },
176
178
  this.experience
177
179
  );
178
- this.experience.edges.push(d);
180
+ this.experience.edges.push(l);
179
181
  },
180
- addFalse(n) {
181
- if (!this.node || !n.node)
182
+ addFalse(s) {
183
+ if (!this.node || !s.node)
182
184
  throw new Error("todo no node");
183
- const d = c(
184
- { sourceNode: this.node, destinationNode: n.node, sourceNodeHandle: "false" },
185
+ const l = c(
186
+ { sourceNode: this.node, destinationNode: s.node, sourceNodeHandle: "false" },
185
187
  this.experience
186
188
  );
187
- this.experience.edges.push(d);
189
+ this.experience.edges.push(l);
188
190
  },
189
191
  serialize() {
190
192
  return r.serialize({
@@ -195,7 +197,7 @@ const r = {
195
197
  }
196
198
  };
197
199
  return p({ conditional: t, type: "conditional" }, o), t;
198
- }, N = (i) => ({
200
+ }, y = (i) => ({
199
201
  id: i.id ?? h("field"),
200
202
  key: i.key ?? m(i.name),
201
203
  name: i.name,
@@ -228,15 +230,15 @@ const r = {
228
230
  validation: this.validation,
229
231
  condition: this.condition,
230
232
  policies: this.policies
231
- }, n = typeof this.defaultValue == "string" ? this.defaultValue : void 0, d = typeof this.defaultValue == "number" ? this.defaultValue : void 0, f = typeof this.defaultValue == "boolean" ? this.defaultValue : void 0;
233
+ }, s = typeof this.defaultValue == "string" ? this.defaultValue : void 0, l = typeof this.defaultValue == "number" ? this.defaultValue : void 0, f = typeof this.defaultValue == "boolean" ? this.defaultValue : void 0;
232
234
  switch (this.type) {
233
235
  case "text":
234
236
  if (this.multiple) {
235
237
  let e;
236
238
  if (Array.isArray(this.defaultValue)) {
237
239
  e = [];
238
- for (const s of this.defaultValue)
239
- typeof s == "string" && e.push(s);
240
+ for (const n of this.defaultValue)
241
+ typeof n == "string" && e.push(n);
240
242
  e.length === 0 && (e = void 0);
241
243
  }
242
244
  return r.serialize({
@@ -244,11 +246,11 @@ const r = {
244
246
  type: "text",
245
247
  multiple: !0,
246
248
  defaultValue: e,
247
- options: this.options ? this.options.map((s) => ({
248
- id: s.id,
249
- label: s.label,
250
- value: `${s.value}`,
251
- condition: s.condition
249
+ options: this.options ? this.options.map((n) => ({
250
+ id: n.id,
251
+ label: n.label,
252
+ value: `${n.value}`,
253
+ condition: n.condition
252
254
  })) : null
253
255
  });
254
256
  }
@@ -256,7 +258,7 @@ const r = {
256
258
  ...t,
257
259
  type: "text",
258
260
  multiple: !1,
259
- defaultValue: n,
261
+ defaultValue: s,
260
262
  options: this.options ? this.options.map((e) => ({
261
263
  id: e.id,
262
264
  label: e.label,
@@ -269,8 +271,8 @@ const r = {
269
271
  let e;
270
272
  if (Array.isArray(this.defaultValue)) {
271
273
  e = [];
272
- for (const s of this.defaultValue)
273
- typeof s == "number" && e.push(s);
274
+ for (const n of this.defaultValue)
275
+ typeof n == "number" && e.push(n);
274
276
  e.length === 0 && (e = void 0);
275
277
  }
276
278
  return r.serialize({
@@ -278,11 +280,11 @@ const r = {
278
280
  type: "number",
279
281
  multiple: !0,
280
282
  defaultValue: e,
281
- options: this.options ? this.options.map((s) => ({
282
- id: s.id,
283
- label: s.label,
284
- value: Number(s.value),
285
- condition: s.condition
283
+ options: this.options ? this.options.map((n) => ({
284
+ id: n.id,
285
+ label: n.label,
286
+ value: Number(n.value),
287
+ condition: n.condition
286
288
  })) : null
287
289
  });
288
290
  }
@@ -290,7 +292,7 @@ const r = {
290
292
  ...t,
291
293
  type: "number",
292
294
  multiple: !1,
293
- defaultValue: d,
295
+ defaultValue: l,
294
296
  options: this.options ? this.options.map((e) => ({
295
297
  id: e.id,
296
298
  label: e.label,
@@ -303,8 +305,8 @@ const r = {
303
305
  let e;
304
306
  if (Array.isArray(this.defaultValue)) {
305
307
  e = [];
306
- for (const s of this.defaultValue)
307
- typeof s == "boolean" && e.push(s);
308
+ for (const n of this.defaultValue)
309
+ typeof n == "boolean" && e.push(n);
308
310
  e.length === 0 && (e = void 0);
309
311
  }
310
312
  return r.serialize({
@@ -312,11 +314,11 @@ const r = {
312
314
  type: "boolean",
313
315
  multiple: !0,
314
316
  defaultValue: e,
315
- options: this.options ? this.options.map((s) => ({
316
- id: s.id,
317
- label: s.label,
318
- value: !!s.value,
319
- condition: s.condition
317
+ options: this.options ? this.options.map((n) => ({
318
+ id: n.id,
319
+ label: n.label,
320
+ value: !!n.value,
321
+ condition: n.condition
320
322
  })) : null
321
323
  });
322
324
  }
@@ -363,7 +365,7 @@ const r = {
363
365
  }
364
366
  }
365
367
  }), E = (i) => {
366
- const o = [], t = [], n = [], d = [], f = [];
368
+ const o = [], t = [], s = [], l = [], f = [];
367
369
  return {
368
370
  id: i.id,
369
371
  component: i.component,
@@ -373,73 +375,77 @@ const r = {
373
375
  targets: i.targets,
374
376
  steps: o,
375
377
  nodes: t,
376
- edges: n,
378
+ edges: s,
377
379
  fields: f,
378
- conditionals: d,
379
- addStep(e, s) {
380
- let l = s?.node;
381
- this.nodes.length === 0 && (l = p({ type: "origin" }, this), this.nodes.push(l));
382
- const a = "serialize" in e ? e : z(e, this);
383
- if (l) {
384
- if (!a.node)
380
+ conditionals: l,
381
+ addStep(e, n) {
382
+ let a = n?.node;
383
+ this.nodes.length === 0 && (a = p({ type: "origin" }, this), this.nodes.push(a));
384
+ let d = "serialize" in e ? e : z(e, this);
385
+ if (d = {
386
+ ...d,
387
+ id: d.id ?? h("step"),
388
+ key: d.key ?? m(d.name)
389
+ }, a) {
390
+ if (!d.node)
385
391
  throw new Error("todo no node");
386
392
  const u = c(
387
- { sourceNode: l, destinationNode: a.node, sourceNodeHandle: null },
393
+ { sourceNode: a, destinationNode: d.node, sourceNodeHandle: null },
388
394
  this
389
395
  );
390
396
  this.edges.push(u);
391
397
  }
392
- return a.fields.length > 0 && a.fields.forEach((u) => {
398
+ return d.fields.length > 0 && d.fields.forEach((u) => {
393
399
  this.fields.includes(u) || this.fields.push(u);
394
- }), this.steps.includes(a) || (this.steps.push(a), a.node && this.nodes.push(a.node)), a;
400
+ }), this.steps.includes(d) || (this.steps.push(d), d.node && this.nodes.push(d.node)), d;
395
401
  },
396
- addAction(e, s) {
397
- let l = s?.node;
398
- this.nodes.length === 0 && (l = p({ type: "origin" }, this), this.nodes.push(l));
399
- const a = "serialize" in e ? e : y(e, this);
400
- if (l) {
402
+ addAction(e, n) {
403
+ let a = n?.node;
404
+ this.nodes.length === 0 && (a = p({ type: "origin" }, this), this.nodes.push(a));
405
+ const d = "serialize" in e ? e : N(e, this);
406
+ if (a) {
401
407
  const u = c(
402
- { sourceNode: l, destinationNode: a, sourceNodeHandle: null },
408
+ { sourceNode: a, destinationNode: d, sourceNodeHandle: null },
403
409
  this
404
410
  );
405
411
  this.edges.push(u);
406
412
  }
407
- return this.nodes.push(a), a;
413
+ return this.nodes.push(d), d;
408
414
  },
409
- addConditional(e, s) {
410
- let l = s?.node;
411
- this.nodes.length === 0 && (l = p({ type: "origin" }, this), this.nodes.push(l));
412
- const a = "serialize" in e ? e : g(e, this);
413
- if (l) {
414
- if (!a.node)
415
+ addConditional(e, n) {
416
+ let a = n?.node;
417
+ this.nodes.length === 0 && (a = p({ type: "origin" }, this), this.nodes.push(a));
418
+ const d = "serialize" in e ? e : g(e, this);
419
+ if (a) {
420
+ if (!d.node)
415
421
  throw new Error("todo no node");
416
422
  const u = c(
417
- { sourceNode: l, destinationNode: a.node, sourceNodeHandle: null },
423
+ { sourceNode: a, destinationNode: d.node, sourceNodeHandle: null },
418
424
  this
419
425
  );
420
426
  this.edges.push(u);
421
427
  }
422
- return this.conditionals.includes(a) || (this.conditionals.push(a), a.node && this.nodes.push(a.node)), a;
428
+ return this.conditionals.includes(d) || (this.conditionals.push(d), d.node && this.nodes.push(d.node)), d;
423
429
  },
424
- addExperience(e, s) {
425
- let l = s?.node;
426
- this.nodes.length === 0 && (l = p({ type: "origin" }, this), this.nodes.push(l));
427
- const a = p(
430
+ addExperience(e, n) {
431
+ let a = n?.node;
432
+ this.nodes.length === 0 && (a = p({ type: "origin" }, this), this.nodes.push(a));
433
+ const d = p(
428
434
  { type: "experience", experience: e },
429
435
  this
430
436
  );
431
- if (this.nodes.push(a), l) {
437
+ if (this.nodes.push(d), a) {
432
438
  const u = c(
433
- { sourceNode: l, destinationNode: a, sourceNodeHandle: null },
439
+ { sourceNode: a, destinationNode: d, sourceNodeHandle: null },
434
440
  this
435
441
  );
436
442
  this.edges.push(u);
437
443
  }
438
444
  return e;
439
445
  },
440
- addField(e, s) {
441
- const l = "serialize" in e ? e : N(e);
442
- return s && s.fields.push(l), this.fields.includes(l) || this.fields.push(l), l;
446
+ addField(e, n) {
447
+ const a = "serialize" in e ? e : y(e);
448
+ return n && n.fields.push(a), this.fields.includes(a) || this.fields.push(a), a;
443
449
  },
444
450
  serialize() {
445
451
  return r.serialize({
@@ -465,7 +471,7 @@ export {
465
471
  c as createEdge,
466
472
  E as createExperience,
467
473
  x as createExperiencePlugin,
468
- N as createField,
474
+ y as createField,
469
475
  p as createNode,
470
476
  V as createStep,
471
477
  r as serialization
@@ -1,5 +1,5 @@
1
- import { a as l } from "../../../api-CQ_YBH_c.js";
2
- import { c as S } from "../../../api-CQ_YBH_c.js";
1
+ import { a as l } from "../../../api-B3JRgxph.js";
2
+ import { c as S } from "../../../api-B3JRgxph.js";
3
3
  import { l as a } from "../../../logger-C9a75KZn.js";
4
4
  function d(e) {
5
5
  let r = 2166136261;
@@ -8,6 +8,7 @@ export interface Nodeable {
8
8
  }
9
9
  export interface SerializableStep extends Nodeable {
10
10
  id: string;
11
+ key: string;
11
12
  name: string;
12
13
  fields: SerializableField[];
13
14
  experience: SerializableExperience;
@@ -19,6 +20,7 @@ export interface SerializableStep extends Nodeable {
19
20
  }
20
21
  export interface CreateStepOptions {
21
22
  id?: string;
23
+ key?: string;
22
24
  name: string;
23
25
  fields?: SerializableField[];
24
26
  }
@@ -140,6 +142,7 @@ export type SerializableField<T extends JsonValue = JsonValue> = {
140
142
  /**
141
143
  * Phantom type property for TypeScript type inference.
142
144
  * This property never exists at runtime but enables type-safe field value access.
145
+ *
143
146
  * @internal
144
147
  */
145
148
  __fieldType?: T;
@@ -191,6 +194,7 @@ export declare const createEdge: (edgeOptions: CreateEdgeOptions, experience: Se
191
194
  export declare const createConditional: (conditionalOptions: CreateConditionalOptions, experience: SerializableExperience) => SerializableConditional;
192
195
  /**
193
196
  * Creates a field with optional generic type parameter for object field type safety.
197
+ *
194
198
  * @template T - The type of the object field value (only applicable for type: 'object')
195
199
  * @param fieldOptions - The field configuration options
196
200
  * @returns A serializable field with type information
@@ -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,E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AAM,MAAM,UAAU,GAAG,IAAI,CAC3B,gBAAgB,EACd,UAAU,GACV,iBAAiB,GACjB,mBAAmB,GACnB,MAAM,GACN,WAAW,GACX,UAAU,GACV,YAAY,CACf,GAAG;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,gBAgCF,CAAA;AAED,eAAO,MAAM,UAAU,GACrB,aAAa,iBAAiB,EAC9B,YAAY,sBAAsB,KACjC,gBA0EF,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;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,WAAW,GAAI,CAAC,SAAS,SAAS,GAAG,SAAS,EACzD,cAAc,kBAAkB,KAC/B,iBAAiB,CAAC,CAAC,CAoOrB,CAAA;AAED,eAAO,MAAM,gBAAgB,GAAI,YAAY,uBAAuB,KAAG,sBAsLtE,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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E,gBAAgB,CAAA;CAC7B;AAED,MAAM,MAAM,UAAU,GAAG,IAAI,CAC3B,gBAAgB,EACd,UAAU,GACV,iBAAiB,GACjB,mBAAmB,GACnB,MAAM,GACN,WAAW,GACX,UAAU,GACV,YAAY,CACf,GAAG;IACF,QAAQ,EAAE,CAAC,mBAAmB,EAAE,kBAAkB,GAAG,iBAAiB,KAAK,IAAI,CAAA;CAChF,CAAA;AAED,eAAO,MAAM,UAAU,GAAI,aAAa,iBAAiB,KAAG,UAiB3D,CAAA;AAED,eAAO,MAAM,kBAAkB,GAC7B,aAAa,iBAAiB,GAAG,UAAU,EAC3C,YAAY,sBAAsB,KACjC,gBAiCF,CAAA;AAED,eAAO,MAAM,UAAU,GACrB,aAAa,iBAAiB,EAC9B,YAAY,sBAAsB,KACjC,gBA0EF,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;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,WAAW,GAAI,CAAC,SAAS,SAAS,GAAG,SAAS,EACzD,cAAc,kBAAkB,KAC/B,iBAAiB,CAAC,CAAC,CAoOrB,CAAA;AAED,eAAO,MAAM,gBAAgB,GAAI,YAAY,uBAAuB,KAAG,sBA4LtE,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@picked/client",
3
- "version": "0.0.1-dev.1773363643396",
3
+ "version": "0.0.1-dev.1773365725739",
4
4
  "dependencies": {
5
5
  "@withease/factories": "^1.0.5"
6
6
  },