@kizenapps/cli 1.13.0 → 1.14.0-cf33224
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/README.md +11 -238
- package/dist/index.js +164 -806
- package/dist/index.js.map +1 -1
- package/dist/viewer/assets/{AppDetailPage-CsAJGeXG.js → AppDetailPage-CGrukEIj.js} +1 -1
- package/dist/viewer/assets/CodeStepsPage-Cu9UiRy9.js +1 -0
- package/dist/viewer/assets/{ConfigurationPage-DUiOAiMK.js → ConfigurationPage-CI0pRNJ0.js} +1 -1
- package/dist/viewer/assets/CredentialsContext-Cwl_xyt_.js +1 -0
- package/dist/viewer/assets/{DevSidebar-CkLpkWSy.js → DevSidebar-BFsoIbMt.js} +1 -1
- package/dist/viewer/assets/{SandboxPage-D3Qdh_0M.js → SandboxPage-Dyb8i7vf.js} +1 -1
- package/dist/viewer/assets/{SecretsPage-CQVPedWl.js → SecretsPage-g2FF7d-B.js} +1 -1
- package/dist/viewer/assets/{WhenBadge-CV5t88Iv.js → WhenBadge-DKz8ukwo.js} +1 -1
- package/dist/viewer/assets/api--pW2v3sH.js +11 -0
- package/dist/viewer/assets/{bootstrapQuery-WnoB2iya.js → bootstrapQuery-DTAPKOf-.js} +1 -1
- package/dist/viewer/assets/index-GvAPdgKb.js +5 -0
- package/dist/viewer/assets/{useCompleteSetup-BgC9V-FN.js → useCompleteSetup-QS3W9RRO.js} +4 -4
- package/dist/viewer/assets/{usePluginConfig-mg5WevIz.js → usePluginConfig--4sAyik4.js} +1 -1
- package/dist/viewer/index.html +4 -4
- package/package.json +20 -26
- package/dist/index.css +0 -2
- package/dist/index.css.map +0 -1
- package/dist/viewer/assets/CodeStepsPage-Dd84cmbe.js +0 -1
- package/dist/viewer/assets/CredentialsContext-p3i8s7a6.js +0 -1
- package/dist/viewer/assets/api-C4R44YCL.js +0 -11
- package/dist/viewer/assets/index-B1r1yKD-.js +0 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{I as t}from"./fa-core-BSqLAjHu.js";import{
|
|
1
|
+
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{I as t}from"./fa-core-BSqLAjHu.js";import{c as n,h as r,w as i}from"./api--pW2v3sH.js";import{c as a,l as o,s,t as c}from"./storageKeys-BDp-0diL.js";import{t as l}from"./setupAssistant-DtI9NWXr.js";var u=e(t(),1);function d(e){function t(t){try{let n=localStorage.getItem(e(t));return n?JSON.parse(n):null}catch{return null}}function n(t,n,r){let a={__kizen_setup_assistant_values:n,__kizen_clean_config:i(r,n)};localStorage.setItem(e(t),JSON.stringify(a))}function r(t,n){let r={__kizen_setup_assistant_values:{},__kizen_clean_config:n};localStorage.setItem(e(t),JSON.stringify(r))}function a(n,r){let i={__kizen_setup_assistant_values:t(n)?.__kizen_setup_assistant_values??{},__kizen_clean_config:r};localStorage.setItem(e(n),JSON.stringify(i))}function o(t){localStorage.removeItem(e(t))}return{load:t,save:n,saveRaw:r,replaceClean:a,clear:o}}var f=d(a),p=d(o),m=f.load,h=f.save,g=f.saveRaw,_=f.replaceClean,v=f.clear,y=p.load,b=p.save,x=p.replaceClean,S=p.clear,C={plan:{},entitlements:{}},w=`kizen:plan-entitlements-changed`,T=e=>typeof e==`object`&&!!e&&!Array.isArray(e);function E(e){return!T(e)||!T(e.plan)||!T(e.entitlements)?!1:Object.values(e.plan).every(T)}function D(){try{let e=localStorage.getItem(s());if(!e)return C;let t=JSON.parse(e);return E(t)?t:C}catch{return C}}function O(e){localStorage.setItem(s(),JSON.stringify(e)),window.dispatchEvent(new Event(w))}function k(){localStorage.removeItem(s()),window.dispatchEvent(new Event(w))}function A(){let[e,t]=(0,u.useState)(D);return(0,u.useEffect)(()=>{let e=()=>{t(D())};return window.addEventListener(w,e),window.addEventListener(c,e),()=>{window.removeEventListener(w,e),window.removeEventListener(c,e)}},[]),e}var j={business:null,user:null};function M(e){return e?{business:m(e),user:y(e)}:j}function N(e,t,i){let[a,o]=(0,u.useState)(()=>M(e)),s=(0,u.useCallback)(()=>{o(M(e))},[e]),c=(0,u.useRef)(e);(0,u.useEffect)(()=>{c.current!==e&&(c.current=e,o(M(e)))},[e]);let d=(0,u.useMemo)(()=>{let e=a.business?.__kizen_clean_config??i??null;return e?l(t?.setup_assistant)||l(t?.user_setup_assistant)?{__kizen_clean_config:e}:{...e}:{}},[a.business,t,i]),f=(0,u.useMemo)(()=>{let t=a.user?.__kizen_clean_config;return!e||!t?[]:[{api_name:e,config:{__kizen_clean_config:t}}]},[e,a.user]),{plan:p,entitlements:m}=A(),h=(0,u.useMemo)(()=>{let e=r(a.business?.__kizen_clean_config??{},[],a.business?.__kizen_setup_assistant_values??{},t?.setup_assistant?.fields),i=r(a.user?.__kizen_clean_config??{},[],a.user?.__kizen_setup_assistant_values??{},t?.user_setup_assistant?.fields),o={};for(let[t,n]of Object.entries(e))o[`config__${t}`]=n;for(let[e,t]of Object.entries(i))o[`userConfig__${e}`]=t;return Object.assign(o,n(p,m)),o},[a.business,a.user,t,p,m]);return(0,u.useMemo)(()=>({configArgs:d,userConfigs:f,whenState:h,refreshConfig:s}),[d,f,h,s])}export{A as a,m as c,x as d,h as f,O as i,y as l,b as m,k as n,v as o,g as p,E as r,S as s,N as t,_ as u};
|
package/dist/viewer/index.html
CHANGED
|
@@ -4,18 +4,18 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>Kizen App Development Toolkit</title>
|
|
7
|
-
<script type="module" crossorigin src="/assets/index-
|
|
7
|
+
<script type="module" crossorigin src="/assets/index-GvAPdgKb.js"></script>
|
|
8
8
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-Dw2cE7zH.js">
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/fa-core-BSqLAjHu.js">
|
|
10
|
-
<link rel="modulepreload" crossorigin href="/assets/CredentialsContext-
|
|
11
|
-
<link rel="modulepreload" crossorigin href="/assets/api
|
|
10
|
+
<link rel="modulepreload" crossorigin href="/assets/CredentialsContext-Cwl_xyt_.js">
|
|
11
|
+
<link rel="modulepreload" crossorigin href="/assets/api--pW2v3sH.js">
|
|
12
12
|
<link rel="modulepreload" crossorigin href="/assets/useQuery-JKMI40WO.js">
|
|
13
13
|
<link rel="modulepreload" crossorigin href="/assets/react-C5hrIo29.js">
|
|
14
14
|
<link rel="modulepreload" crossorigin href="/assets/BootstrapContext-CS2e3X9Y.js">
|
|
15
15
|
<link rel="modulepreload" crossorigin href="/assets/useParams-D3awshYI.js">
|
|
16
16
|
<link rel="modulepreload" crossorigin href="/assets/useNavigate-BL0GTcH4.js">
|
|
17
17
|
<link rel="modulepreload" crossorigin href="/assets/SidebarContext-q5sbcZXM.js">
|
|
18
|
-
<link rel="modulepreload" crossorigin href="/assets/bootstrapQuery-
|
|
18
|
+
<link rel="modulepreload" crossorigin href="/assets/bootstrapQuery-DTAPKOf-.js">
|
|
19
19
|
<link rel="modulepreload" crossorigin href="/assets/bundleQuery-BE1Gb8Ii.js">
|
|
20
20
|
<link rel="modulepreload" crossorigin href="/assets/Card-Sa52PGkn.js">
|
|
21
21
|
<link rel="modulepreload" crossorigin href="/assets/Dialog-C3QoiHOt.js">
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kizenapps/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.14.0-cf33224",
|
|
4
4
|
"description": "CLI tool for running Kizen plugin apps locally",
|
|
5
5
|
"license": "GPL-3.0-only",
|
|
6
6
|
"repository": {
|
|
@@ -28,25 +28,6 @@
|
|
|
28
28
|
"files": [
|
|
29
29
|
"dist"
|
|
30
30
|
],
|
|
31
|
-
"scripts": {
|
|
32
|
-
"build": "pnpm run build:cli && pnpm run build:viewer && pnpm run build:notices",
|
|
33
|
-
"build:cli": "tsup",
|
|
34
|
-
"build:notices": "node scripts/generate-third-party-notices.js",
|
|
35
|
-
"watch": "concurrently -n cli,viewer -c cyan,magenta \"tsup --watch\" \"vite build --watch --config viewer/vite.config.ts\"",
|
|
36
|
-
"build:viewer": "vite build --config viewer/vite.config.ts",
|
|
37
|
-
"typecheck": "tsc --noEmit && tsc --noEmit -p viewer/tsconfig.json",
|
|
38
|
-
"lint": "eslint src shared viewer/src",
|
|
39
|
-
"lint:fix": "eslint src shared viewer/src --fix",
|
|
40
|
-
"test": "vitest run",
|
|
41
|
-
"test:watch": "vitest",
|
|
42
|
-
"test:coverage": "vitest run --coverage",
|
|
43
|
-
"format": "prettier --write .",
|
|
44
|
-
"format:check": "prettier --check .",
|
|
45
|
-
"start": "appbuilder",
|
|
46
|
-
"prepublishOnly": "pnpm run typecheck && pnpm run lint && pnpm run test && pnpm run build",
|
|
47
|
-
"version:prerelease": "node scripts/version-prerelease.js",
|
|
48
|
-
"version:check": "node scripts/version-release.js"
|
|
49
|
-
},
|
|
50
31
|
"dependencies": {
|
|
51
32
|
"@kizenapps/engine": "1.10.0",
|
|
52
33
|
"@kizenapps/packager": "0.9.0",
|
|
@@ -68,11 +49,6 @@
|
|
|
68
49
|
"unist-util-visit": "^5.1.0",
|
|
69
50
|
"ws": "^8.18.0"
|
|
70
51
|
},
|
|
71
|
-
"pnpm": {
|
|
72
|
-
"onlyBuiltDependencies": [
|
|
73
|
-
"esbuild"
|
|
74
|
-
]
|
|
75
|
-
},
|
|
76
52
|
"devDependencies": {
|
|
77
53
|
"@fortawesome/fontawesome-svg-core": "^7.2.0",
|
|
78
54
|
"@fortawesome/free-solid-svg-icons": "^7.2.0",
|
|
@@ -103,5 +79,23 @@
|
|
|
103
79
|
"typescript-eslint": "^8.58.2",
|
|
104
80
|
"vite": "^8.0.8",
|
|
105
81
|
"vitest": "^4.1.11"
|
|
82
|
+
},
|
|
83
|
+
"scripts": {
|
|
84
|
+
"build": "pnpm run build:cli && pnpm run build:viewer && pnpm run build:notices",
|
|
85
|
+
"build:cli": "tsup",
|
|
86
|
+
"build:notices": "node scripts/generate-third-party-notices.js",
|
|
87
|
+
"watch": "concurrently -n cli,viewer -c cyan,magenta \"tsup --watch\" \"vite build --watch --config viewer/vite.config.ts\"",
|
|
88
|
+
"build:viewer": "vite build --config viewer/vite.config.ts",
|
|
89
|
+
"typecheck": "tsc --noEmit && tsc --noEmit -p viewer/tsconfig.json",
|
|
90
|
+
"lint": "eslint src shared viewer/src",
|
|
91
|
+
"lint:fix": "eslint src shared viewer/src --fix",
|
|
92
|
+
"test": "vitest run",
|
|
93
|
+
"test:watch": "vitest",
|
|
94
|
+
"test:coverage": "vitest run --coverage",
|
|
95
|
+
"format": "prettier --write .",
|
|
96
|
+
"format:check": "prettier --check .",
|
|
97
|
+
"start": "appbuilder",
|
|
98
|
+
"version:prerelease": "node scripts/version-prerelease.js",
|
|
99
|
+
"version:check": "node scripts/version-release.js"
|
|
106
100
|
}
|
|
107
|
-
}
|
|
101
|
+
}
|
package/dist/index.css
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
.hello-frame{padding:16px;font-family:system-ui,sans-serif}.hello-frame__title{margin:0 0 8px;font-size:16px}.hello-frame__body{margin:0;color:#555}.hello-block{padding:16px;font-family:system-ui,sans-serif;background:#f8fafc;border-radius:6px}.hello-block__title{margin:0 0 8px;font-size:16px}.hello-block__body{margin:0;color:#555}.hello-page{padding:24px;font-family:system-ui,sans-serif}.hello-page__title{margin:0 0 8px;font-size:20px}.hello-page__body{margin:0 0 16px;color:#555}.hello-page__loading{margin:0;color:#94a3b8}.hello-page__actions{display:flex;gap:8px}.hello-page__button{padding:6px 12px;font:inherit;color:#0f172a;background:#e2e8f0;border:0;border-radius:4px;cursor:pointer}.hello-page__button:hover{background:#cbd5e1}
|
|
2
|
-
/*# sourceMappingURL=index.css.map */
|
package/dist/index.css.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["raw:/Users/keegan/Developer/app-builder/src/templates/artifacts/floatingFrames/helloFrame/styles.css","raw:/Users/keegan/Developer/app-builder/src/templates/artifacts/blocks/helloBlock/styles.css","raw:/Users/keegan/Developer/app-builder/src/templates/artifacts/pages/helloPage/styles.css"],"sourcesContent":["/* Packaged as the frame's `css` and injected when it renders. Keep class\n names specific to this artifact so they can't collide with another one. */\n\n.hello-frame {\n padding: 16px;\n font-family: system-ui, sans-serif;\n}\n\n.hello-frame__title {\n margin: 0 0 8px;\n font-size: 16px;\n}\n\n.hello-frame__body {\n margin: 0;\n color: #555;\n}\n","/* Packaged as the block's `styles` and injected when it renders. */\n\n.hello-block {\n padding: 16px;\n font-family: system-ui, sans-serif;\n background: #f8fafc;\n border-radius: 6px;\n}\n\n.hello-block__title {\n margin: 0 0 8px;\n font-size: 16px;\n}\n\n.hello-block__body {\n margin: 0;\n color: #555;\n}\n","/* Packaged as the page's `css` and injected when the page renders. */\n\n.hello-page {\n padding: 24px;\n font-family: system-ui, sans-serif;\n}\n\n.hello-page__title {\n margin: 0 0 8px;\n font-size: 20px;\n}\n\n.hello-page__body {\n margin: 0 0 16px;\n color: #555;\n}\n\n.hello-page__loading {\n margin: 0;\n color: #94a3b8;\n}\n\n.hello-page__actions {\n display: flex;\n gap: 8px;\n}\n\n.hello-page__button {\n padding: 6px 12px;\n font: inherit;\n color: #0f172a;\n background: #e2e8f0;\n border: 0;\n border-radius: 4px;\n cursor: pointer;\n}\n\n.hello-page__button:hover {\n background: #cbd5e1;\n}\n"],"mappings":"AAGA,CAAC,YAHD,QAIW,KACT,YAAa,SAAS,CAAE,UAC1B,CAEA,CAAC,mBARD,OASU,EAAE,EAAE,IACZ,UAAW,IACb,CAEA,CAAC,kBAbD,OAcU,EACR,MAAO,IACT,CCdA,CAAC,YAFD,QAGW,KACT,YAAa,SAAS,CAAE,WACxB,WAAY,QALd,cAMiB,GACjB,CAEA,CAAC,mBATD,OAUU,EAAE,EAAE,IACZ,UAAW,IACb,CAEA,CAAC,kBAdD,OAeU,EACR,MAAO,IACT,CCfA,CAAC,WAFD,QAGW,KACT,YAAa,SAAS,CAAE,UAC1B,CAEA,CAAC,kBAPD,OAQU,EAAE,EAAE,IACZ,UAAW,IACb,CAEA,CAAC,iBAZD,OAaU,EAAE,EAAE,KACZ,MAAO,IACT,CAEA,CAAC,oBAjBD,OAkBU,EACR,MAAO,OACT,CAEA,CAAC,oBACC,QAAS,KACT,IAAK,GACP,CAEA,CAAC,mBA3BD,QA4BW,IAAI,KACb,KAAM,QACN,MAAO,QACP,WAAY,QACZ,OAAQ,EAhCV,cAiCiB,IACf,OAAQ,OACV,CAEA,CAVC,kBAUkB,OACjB,WAAY,OACd","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{A as t,E as n,F as r,I as i,P as a,a as o,s}from"./fa-core-BSqLAjHu.js";import{t as c}from"./useNavigate-BL0GTcH4.js";import{t as l}from"./useParams-D3awshYI.js";import{t as u}from"./useQuery-JKMI40WO.js";import{t as d}from"./bundleQuery-BE1Gb8Ii.js";import{n as f}from"./api-C4R44YCL.js";import{t as p}from"./Card-Sa52PGkn.js";import{t as m}from"./CodeViewer-CVECJY4e.js";import{t as h}from"./useLocalStorage-wp83IS34.js";import{t as g}from"./usePluginConfig-mg5WevIz.js";import{t as _}from"./WhenBadge-CV5t88Iv.js";var v=e(i(),1);function y(e){return e==null||e.trim()===``?null:e}function b(e,t){return Object.fromEntries(e.map(e=>[e,y(t[e])]))}var x=r(),S=({title:e,defaultOpen:t=!1,children:n})=>{let[r,i]=(0,v.useState)(t);return(0,x.jsxs)(`div`,{children:[(0,x.jsxs)(`button`,{onClick:()=>{i(e=>!e)},className:`flex w-full items-center gap-1.5 py-1 text-[11px] font-semibold uppercase tracking-widest text-neutral-400 hover:text-neutral-600`,children:[(0,x.jsx)(a,{icon:r?o:s,className:`w-2.5`}),e]}),r&&(0,x.jsx)(`div`,{className:`pb-2`,children:n})]})},C=({result:e})=>{let t=Object.entries(e.outputValues);return(0,x.jsxs)(`div`,{className:`space-y-3 rounded-lg border border-black/10 bg-white p-4`,children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,x.jsx)(`span`,{className:`rounded px-2 py-0.5 text-[11px] font-semibold ${e.success?`bg-green-100 text-green-700`:`bg-red-100 text-red-700`}`,children:e.success?`Success`:`Error`}),(0,x.jsxs)(`span`,{className:`text-[11px] text-neutral-400`,children:[String(e.durationMs),`ms`]}),e.exitCode!==0&&(0,x.jsxs)(`span`,{className:`text-[11px] text-neutral-400`,children:[`exit code `,String(e.exitCode)]}),(0,x.jsx)(`button`,{onClick:e=>{let t=e.currentTarget;for(;t;){if(t.scrollHeight>t.clientHeight){t.scrollTo({top:0,behavior:`smooth`});return}t=t.parentElement}},className:`ml-auto text-[11px] text-neutral-400 hover:text-neutral-600`,children:`↑ top`})]}),e.error&&(0,x.jsx)(`pre`,{className:`overflow-auto rounded bg-red-50 p-3 font-mono text-[12px] text-red-800`,children:e.error}),t.length>0&&(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`div`,{className:`mb-1 text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:`Outputs`}),(0,x.jsx)(`div`,{className:`divide-y divide-black/5`,children:t.map(([e,t])=>(0,x.jsxs)(`div`,{className:`flex items-start gap-2 py-1.5`,children:[(0,x.jsx)(`span`,{className:`shrink-0 font-mono text-[12px] text-neutral-600`,children:e}),(0,x.jsx)(`span`,{className:`text-[11px] text-neutral-300`,children:`=`}),(0,x.jsx)(`pre`,{className:`min-w-0 flex-1 overflow-auto font-mono text-[12px] text-neutral-800`,children:typeof t==`string`?t:JSON.stringify(t,null,2)})]},e))})]}),e.logs.length>0&&(0,x.jsx)(S,{title:`Logs (${String(e.logs.length)})`,children:(0,x.jsx)(`div`,{className:`space-y-0.5`,children:e.logs.map((e,t)=>(0,x.jsx)(`div`,{className:`font-mono text-[12px] text-neutral-600`,children:e},t))})}),e.stdout&&(0,x.jsx)(S,{title:`Stdout`,children:(0,x.jsx)(`pre`,{className:`overflow-auto rounded bg-neutral-50 p-3 font-mono text-[12px] text-neutral-700`,children:e.stdout})}),e.stderr&&(0,x.jsx)(S,{title:`Stderr`,children:(0,x.jsx)(`pre`,{className:`overflow-auto rounded bg-neutral-50 p-3 font-mono text-[12px] text-neutral-700`,children:e.stderr})}),e.httpRequests&&e.httpRequests.count>0&&(0,x.jsx)(S,{title:`Network (${String(e.httpRequests.count)}${e.httpRequests.notLogged>0?`, ${String(e.httpRequests.notLogged)} not logged`:``})`,children:(0,x.jsx)(`div`,{className:`space-y-1.5`,children:e.httpRequests.requests.map((e,t)=>(0,x.jsx)(E,{request:e},t))})})]})},w=e=>{switch(e.toUpperCase()){case`GET`:return`bg-blue-100 text-blue-700`;case`POST`:return`bg-green-100 text-green-700`;case`PUT`:case`PATCH`:return`bg-amber-100 text-amber-700`;case`DELETE`:return`bg-red-100 text-red-700`;default:return`bg-neutral-100 text-neutral-700`}},T=(e,t)=>t||e>=500?`text-red-700`:e>=400?`text-amber-700`:e>=200?`text-green-700`:`text-neutral-600`,E=({request:e})=>{let[t,n]=(0,v.useState)(!1),r=e.requestErrorType!==null;return(0,x.jsxs)(`div`,{className:`rounded border border-black/5 bg-neutral-50`,children:[(0,x.jsxs)(`button`,{onClick:()=>{n(e=>!e)},className:`flex w-full items-center gap-2 px-2.5 py-1.5 text-left hover:bg-neutral-100`,children:[(0,x.jsx)(a,{icon:t?o:s,className:`w-2.5 text-neutral-400`}),(0,x.jsx)(`span`,{className:`rounded px-1.5 py-0.5 font-mono text-[10px] font-semibold ${w(e.method)}`,children:e.method}),(0,x.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-[12px] text-neutral-700`,children:e.url}),(0,x.jsx)(`span`,{className:`font-mono text-[11px] font-semibold ${T(e.responseStatusCode,r)}`,children:r?e.requestErrorType:e.responseStatusCode}),(0,x.jsxs)(`span`,{className:`font-mono text-[10px] text-neutral-400`,children:[(e.duration*1e3).toFixed(0),`ms`]})]}),t&&(0,x.jsxs)(`div`,{className:`space-y-2 border-t border-black/5 p-2.5`,children:[(0,x.jsx)(D,{title:`Request Headers`,data:e.headers}),e.body&&(0,x.jsx)(O,{title:`Request Body`,body:e.body}),(0,x.jsx)(D,{title:`Response Headers`,data:e.responseHeaders}),e.responseBody&&(0,x.jsx)(O,{title:`Response Body`,body:e.responseBody})]})]})},D=({title:e,data:t})=>{let n=Object.entries(t);return n.length===0?null:(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`div`,{className:`mb-1 text-[10px] font-semibold uppercase tracking-widest text-neutral-400`,children:e}),(0,x.jsx)(`div`,{className:`divide-y divide-black/5 rounded border border-black/5 bg-white`,children:n.map(([e,t])=>(0,x.jsxs)(`div`,{className:`flex gap-2 px-2 py-1 font-mono text-[11px]`,children:[(0,x.jsxs)(`span`,{className:`shrink-0 text-neutral-500`,children:[e,`:`]}),(0,x.jsx)(`span`,{className:`min-w-0 flex-1 break-all text-neutral-800`,children:t})]},e))})]})},O=({title:e,body:t})=>(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`div`,{className:`mb-1 text-[10px] font-semibold uppercase tracking-widest text-neutral-400`,children:e}),(0,x.jsx)(`pre`,{className:`overflow-auto rounded border border-black/5 bg-white p-2 font-mono text-[11px] text-neutral-800`,children:t})]}),k=[`python-3-12`,`python-3-13`],A=`python-3-13`,j={text:`s`,string:`s`,number:`n`,integer:`n`,boolean:`b`,date:`d`,datetime:`dt`,phone:`p`,phonenumber:`p`,uuid:`u`,file:`f`,list:`l`};function M(e){return j[e.toLowerCase()]??`s`}function N(e){return k.includes(e)}function P(e,t){let n=Object.keys(e);if(n.length===0)return null;let r={};for(let i of n)r[i]={t:M(t[i]??`string`),v:y(e[i])};return r}function F(e){let t=Object.keys(e);if(t.length===0)return null;let n={};for(let r of t)n[r]=M(e[r]??`string`);return n}function I(e){if(!e)return{};let t={};for(let[n,r]of Object.entries(e))t[n]=r.v;return t}function L(e){if(!e)return;let t=e.requests.map(e=>({method:e.method,url:e.url,headers:e.headers,body:e.body,requestSubmittedAt:e.requestSubmittedAt,session:e.session,responseStatusCode:e.responseStatusCode,responseHeaders:e.responseHeaders,responseBody:e.responseBody,requestErrorType:e.requestErrorType,duration:e.duration}));return{count:e.count,notLogged:e.not_logged,requests:t}}async function R(e,t){let n=Date.now(),r=t.scriptRuntime||A;if(!N(r))return{success:!1,outputValues:{},logs:[],stdout:``,stderr:``,error:`Unsupported runtime "${r}". Supported runtimes: ${k.join(`, `)}. Update the step's config.json "runtime" field (e.g. "python 3.13").`,exitCode:1,durationMs:Date.now()-n};let i={user_script:t.script,runtime:r,secrets:t.secretNames.length>0?t.secretNames:void 0,inputs:P(t.inputs,t.inputTypes),output_types:F(t.outputTypes)};try{let t=await e(`/coderunner/run`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(i)}),r=Date.now()-n;if(!t.ok){let e=await t.text();return{success:!1,outputValues:{},logs:[],stdout:``,stderr:``,error:`Remote runner returned ${String(t.status)}: ${e}`,exitCode:1,durationMs:r}}let a=await t.json(),o=a.error!==null,s=L(a.http_requests),c={success:!o,outputValues:I(a.values),logs:a.logs??[],stdout:``,stderr:``,exitCode:+!!o,durationMs:a.duration_ms??r,...s&&{httpRequests:s}};return o&&a.error&&(c.error=a.error.detail?`${a.error.error}\n${a.error.detail}`:a.error.error),c}catch(e){return{success:!1,outputValues:{},logs:[],stdout:``,stderr:``,error:`Remote execution failed: ${e instanceof Error?e.message:String(e)}`,exitCode:1,durationMs:Date.now()-n}}}var z=()=>{let{apiName:e,stepApiName:r}=l({strict:!1}),i=c(),{data:o,isLoading:s,isError:y}=u(d),S=f(),[w,T]=(0,v.useState)(!1),[E,D]=(0,v.useState)(null),[O,k]=h(`kizen-step-inputs:${e??``}:${r??``}`,{}),[A,j]=h(`kizen-step-secrets:${e??``}:${r??``}`,{}),[M,N]=h(`kizen-code-runner-mode`,`local`),P=(0,v.useMemo)(()=>o?.find(t=>t.api_name===e),[o,e]),F=(0,v.useMemo)(()=>P?.artifacts.automation_action_configs??[],[P]),I=F.find(e=>e.action_step_api_name===r)??F[0],L=P?.base_config,{whenState:z}=g(e,L,P?.config_template);if((0,v.useEffect)(()=>{if(!r&&F.length>0&&e){let t=F[0];t&&i({to:`/$apiName/code-steps/$stepApiName`,params:{apiName:e,stepApiName:t.action_step_api_name},replace:!0})}},[r,F,e,i]),(0,v.useEffect)(()=>{D(null)},[r]),s)return(0,x.jsx)(p,{children:(0,x.jsx)(`p`,{className:`m-0 text-[13px] text-neutral-400`,children:`Fetching bundle.json…`})});if(y)return(0,x.jsx)(p,{children:(0,x.jsx)(`p`,{className:`m-0 text-[13px] text-red-700`,children:`Could not load bundle.json.`})});if(!P)return(0,x.jsx)(p,{children:(0,x.jsxs)(`p`,{className:`m-0 text-[13px] text-neutral-500`,children:[`No app found with api_name`,` `,(0,x.jsx)(`code`,{className:`rounded bg-neutral-100 px-1 py-0.5`,children:e}),`.`]})});if(F.length===0)return(0,x.jsx)(p,{children:(0,x.jsx)(`p`,{className:`m-0 text-[13px] text-neutral-500`,children:`This app has no automation code steps.`})});if(!I)return(0,x.jsx)(p,{children:(0,x.jsxs)(`p`,{className:`m-0 text-[13px] text-neutral-500`,children:[`Step not found: `,(0,x.jsx)(`code`,{className:`rounded bg-neutral-100 px-1 py-0.5`,children:r}),`.`]})});let B=async()=>{T(!0),D(null);try{let t=b(I.inputs.map(e=>e.name),O),n;n=M===`remote`?await R(S,{script:I.script,scriptRuntime:I.script_runtime,inputs:t,inputTypes:Object.fromEntries(I.inputs.map(e=>[e.name,e.data_type])),outputTypes:Object.fromEntries(I.outputs.map(e=>[e.name,e.data_type])),secretNames:I.secrets.map(t=>`${e??``}__${t}`)}):await(await fetch(`/api/execute-step`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({script:I.script,scriptRuntime:I.script_runtime,inputs:t,secrets:Object.fromEntries(I.secrets.map(t=>[`${e??``}__${t}`,A[t]??``]))})})).json(),D(n)}catch(e){D({success:!1,outputValues:{},logs:[],stdout:``,stderr:``,error:e instanceof Error?e.message:String(e),exitCode:1,durationMs:0})}finally{T(!1)}};return(0,x.jsxs)(`div`,{className:`space-y-4`,children:[(0,x.jsxs)(p,{children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,x.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:`Code Step`}),(0,x.jsx)(`select`,{value:I.action_step_api_name,onChange:t=>{e&&i({to:`/$apiName/code-steps/$stepApiName`,params:{apiName:e,stepApiName:t.target.value}})},className:`rounded border border-black/10 bg-transparent px-2 py-0.5 text-[13px] font-mono text-neutral-700 focus:outline-none`,children:F.map(e=>(0,x.jsx)(`option`,{value:e.action_step_api_name,children:e.name},e.action_step_api_name))}),(0,x.jsx)(`div`,{className:`flex-1`}),(0,x.jsx)(`span`,{className:`rounded bg-blue-50 px-1.5 py-0.5 text-[10px] font-semibold text-blue-600`,children:I.script_runtime})]}),I.action_description&&(0,x.jsx)(`p`,{className:`mt-2 text-[12px] text-neutral-500`,children:I.action_description}),I.when&&(0,x.jsx)(`div`,{className:`mt-2`,children:(0,x.jsx)(_,{when:I.when,whenState:z})})]}),(0,x.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-3`,children:[(0,x.jsxs)(p,{children:[(0,x.jsx)(`div`,{className:`mb-3 text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:`Inputs`}),I.inputs.length>0?(0,x.jsx)(`div`,{className:`space-y-3`,children:I.inputs.map(e=>(0,x.jsxs)(`div`,{children:[(0,x.jsxs)(`label`,{className:`mb-1 block text-[12px] text-neutral-700`,children:[e.label,e.required&&(0,x.jsx)(`span`,{className:`ml-0.5 text-red-500`,children:`*`})]}),(0,x.jsx)(`input`,{type:`text`,value:O[e.name]??``,onChange:t=>{k({...O,[e.name]:t.target.value})},placeholder:e.name,className:`w-full rounded border border-black/10 bg-white px-2.5 py-1.5 font-mono text-[13px] text-neutral-800 placeholder:text-neutral-300 focus:border-blue-300 focus:outline-none`}),(0,x.jsx)(`div`,{className:`mt-0.5 font-mono text-[10px] text-neutral-400`,children:e.name})]},e.name))}):(0,x.jsx)(`p`,{className:`m-0 text-[12px] text-neutral-400`,children:`None defined.`})]}),(0,x.jsxs)(p,{children:[(0,x.jsx)(`div`,{className:`mb-3 text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:`Outputs`}),I.outputs.length>0?(0,x.jsx)(`div`,{className:`space-y-2`,children:I.outputs.map(e=>(0,x.jsxs)(`div`,{className:`flex items-baseline gap-2 rounded border border-black/5 bg-neutral-50 px-2.5 py-1.5`,children:[(0,x.jsx)(`span`,{className:`text-[13px] text-neutral-700`,children:e.label}),(0,x.jsx)(`span`,{className:`font-mono text-[10px] text-neutral-400`,children:e.name}),(0,x.jsx)(`span`,{className:`ml-auto rounded bg-white px-1.5 py-0.5 font-mono text-[10px] text-neutral-500`,children:e.data_type})]},e.name))}):(0,x.jsx)(`p`,{className:`m-0 text-[12px] text-neutral-400`,children:`None defined.`})]}),(0,x.jsxs)(p,{children:[(0,x.jsx)(`div`,{className:`mb-3 text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:`Secrets`}),M===`remote`&&(0,x.jsx)(`p`,{className:`mb-3 rounded border border-blue-100 bg-blue-50 px-2.5 py-1.5 text-[12px] text-blue-700`,children:`Remote runner uses secrets from your business context.`}),I.secrets.length>0?(0,x.jsx)(`div`,{className:`space-y-3`,children:I.secrets.map(e=>(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`label`,{className:`mb-1 block text-[12px] text-neutral-700`,children:e}),(0,x.jsx)(`input`,{type:`password`,value:A[e]??``,onChange:t=>{j({...A,[e]:t.target.value})},placeholder:e,disabled:M===`remote`,className:`w-full rounded border border-black/10 bg-white px-2.5 py-1.5 font-mono text-[13px] text-neutral-800 placeholder:text-neutral-300 focus:border-blue-300 focus:outline-none disabled:cursor-not-allowed disabled:bg-neutral-50 disabled:text-neutral-400`})]},e))}):(0,x.jsx)(`p`,{className:`m-0 text-[12px] text-neutral-400`,children:`None defined.`})]})]}),(0,x.jsx)(m,{code:I.script,language:`python`,onRun:()=>void B(),isRunning:w,executionMode:M,onModeChange:N}),(0,x.jsx)(`div`,{className:`sticky bottom-0 z-10 max-h-[60vh] overflow-y-auto rounded-lg shadow-[0_-8px_24px_-12px_rgba(0,0,0,0.18)]`,children:E?(0,x.jsx)(C,{result:E}):(0,x.jsx)(`div`,{className:`flex items-center gap-2 rounded-lg border border-dashed border-black/10 bg-white px-4 py-3`,children:w?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(a,{icon:t,className:`animate-spin text-neutral-400`}),(0,x.jsx)(`span`,{className:`text-[12px] text-neutral-500`,children:`Running step…`})]}):(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(a,{icon:n,className:`text-neutral-300`}),(0,x.jsx)(`span`,{className:`text-[12px] text-neutral-400`,children:`Run the step to see output, logs, and network activity here.`})]})})})]})};export{z as CodeStepsPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{I as t}from"./fa-core-BSqLAjHu.js";var n=e(t(),1),r=[`go`,`fmo`,`staging`,`integration`,`test1`];function i(e){return typeof e==`string`?e.trim():``}function a(e){return{apiKey:i(e.apiKey),userId:i(e.userId),businessId:i(e.businessId)}}var o=(0,n.createContext)({apiKey:``,userId:``,businessId:``,environment:`go`}),s=()=>(0,n.useContext)(o);export{a as i,s as n,r,o as t};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{I as t}from"./fa-core-BSqLAjHu.js";import{n}from"./CredentialsContext-p3i8s7a6.js";var r=e(t(),1),i={go:`https://app.go.kizen.com/api`,fmo:`https://app.fmo.kizen.com/api`,staging:`https://staging.kizen.com/api`,integration:`https://integration.kizen.dev/api`,test1:`https://test1.kizen.dev/api`},a={go:`https://go.kizen.com`,fmo:`https://fmo.kizen.com`,staging:`https://v2.staging.kizen.com`,integration:`https://v2.integration.kizen.dev`,test1:`https://test1.kizen.dev`},o=new Set([`get`,`delete`,`head`]),s=class extends Error{code;request;response;__isMock=!0;constructor({code:e,request:t,response:n}){super(`Request failed with status ${String(e)}`),this.code=e,this.request=t,this.response=n}},c=e=>typeof e==`object`&&!!e&&`__isMock`in e,l=async(e,t,n,r,i)=>{let a=r!=null,o=r instanceof FormData||r instanceof Blob,c=a&&!o?{"Content-Type":`application/json`,...i?.headers}:i?.headers,l=await e(n,{method:t,...a&&{body:o?r:JSON.stringify(r)},...c&&{headers:c}});if(!l.ok)throw new s({code:l.status,request:{method:t.toUpperCase(),url:n,body:r,headers:c},response:{data:{error:`Request failed with status ${String(l.status)}`},status:l.status}});return l.status===204||l.headers.get(`content-length`)===`0`?{}:await l.json()};function u(e){return{get:(t,n)=>l(e,`GET`,t,void 0,n),delete:(t,n)=>l(e,`DELETE`,t,void 0,n),head:(t,n)=>l(e,`HEAD`,t,void 0,n),post:(t,n,r)=>l(e,`POST`,t,n,r),put:(t,n,r)=>l(e,`PUT`,t,n,r),patch:(t,n,r)=>l(e,`PATCH`,t,n,r),request:(t,n,r,i)=>{let a=t.toLowerCase(),s=o.has(a)?r:i,c=o.has(a)?void 0:r;return l(e,t.toUpperCase(),n,c,s)}}}var d={QUERY_REQUEST:`query:request`,UI_OUTPUT:`outputui`,IFRAME_OUTPUT:`iframeoutput`,POSTFORMDATA_REQUEST:`postformdata:request`,SETSTATE:`setstate`,DONE:`done`,RUN:`run`,OPEN_WINDOW:`openwindow`,COMMUNICATE:`communicate`,HIDE:`hide`,SHOW:`show`,EXPAND:`expand`,COLLAPSE:`collapse`,HIDE_HEADER:`hideheader`,SHOW_HEADER:`showheader`,OPEN_CREATE_RECORD_MODAL_REQUEST:`opencreaterecordmodal:request`,OPEN_CREATE_RELATED_RECORD_MODAL_REQUEST:`opencreaterelatedrecordmodal:request`,SHOW_TOAST:`showtoast`,CLEAR_TOASTS:`cleartoasts`,REFRESH_TIMELINE:`refreshtimeline`,REFRESH_ENTITY:`refreshentity`,UPLOADFILE_REQUEST:`uploadfile:request`,UPDATE_SESSION_DATA:`updatesessiondata`,INSTALL_THIRD_PARTY_SCRIPT_REQUEST:`installthirdpartyscript:request`,PROMPT_REQUEST:`prompt:request`,DYNAMIC_PROMPT_REQUEST:`dynamicprompt:request`,RELEASE_BLOCKING_SCRIPT:`releaseblockingscript`,AUTHORIZE:`authorize`,COPY_TO_CLIPBOARD:`copytoclipboard`,SHOW_VIEW_IN_MODAL_REQUEST:`showviewinmodal:request`,CLOSE_MODAL_REQUEST:`closemodal:request`,CONSOLE_LOG:`consolelog`,RUN_EVENT_SCRIPT:`runeventscript`,COMPLETE_SETUP_REQUEST:`completesetup:request`},f={QUERY_RESPONSE:`query:response`,POSTFORMDATA_RESPONSE:`postformdata:response`,ERROR:`error`,UPLOADFILE_RESPONSE:`uploadfile:response`,UPLOADFILE_PROGRESS:`uploadfile:progress`,INSTALL_THIRD_PARTY_SCRIPT_RESPONSE:`installthirdpartyscript:response`,PROMPT_RESPONSE:`prompt:response`,REFRESH_ENTITY_RESPONSE:`refreshentity:response`,CREATE_RECORD_RESPONSE:`createrecord:response`,CREATE_RELATED_RECORD_RESPONSE:`createrelatedrecord:response`,COMPLETE_SETUP_RESPONSE:`completesetup:response`},p={RUN_FRAME_SCRIPT:`runframescript`,RUN_BLOCK_SCRIPT:`runblockscript`,SEND_MESSAGE_TO_FRAME:`sendmessagetoframe`,CALL_THIRD_PARTY_SCRIPT:`callthirdpartyscript`},m=`integration:route-change`,h=`kizen-route-change`,g=`kzn-integration-frame`,_=[`__plugin_engine`,`1.10.0`],v={CALENDAR_SOURCE_CALENDAR_LIST:(e,t)=>[..._,`calendar-source`,`calendar-list`,e,t],CALENDAR_SOURCE_EVENTS:(e,t,n,r)=>[..._,`calendar-source`,`events`,e,t,n,r]},y=/https:\/\/.*widget\.freshworks\.com\/.*\.js/,b=/https:\/\/widget\.intercom\.io\/widget\/[a-z0-9]+/,x={FRESHWORKS:`freshworks`,INTERCOM:`intercom`},S=e=>{if(y.test(e))return x.FRESHWORKS;if(b.test(e))return x.INTERCOM},C={[x.FRESHWORKS]:`FreshworksWidget`,[x.INTERCOM]:`Intercom`},w={[x.FRESHWORKS]:e=>{window.fwSettings={widget_id:e.widgetId},(function(...e){if(typeof window[C[x.FRESHWORKS]]!=`function`){let t=function(){t.q.push(...e)};t.__kizen_pending=!0,t.q=[],window[C[x.FRESHWORKS]]=t}})()},[x.INTERCOM]:()=>{(function(){if(typeof window[C[x.INTERCOM]]!=`function`){let e=window,t=function(){t.c(arguments)};t.q=[],t.c=function(e){t.q.push(e)},t.__kizen_pending=!0,e[C[x.INTERCOM]]=t}})()}},T={[x.FRESHWORKS]:()=>window[C[x.FRESHWORKS]]?.__kizen_pending!==!0,[x.INTERCOM]:()=>window[C[x.INTERCOM]]?.__kizen_pending!==!0},E=()=>({host:window.location.host,hash:window.location.hash,href:window.location.href,origin:window.location.origin,pathname:window.location.pathname,search:window.location.search,port:window.location.port,protocol:window.location.protocol}),ee=()=>{let e=new Date().getTime();return typeof performance<`u`&&typeof performance.now==`function`&&(e+=performance.now()),`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g,t=>{let n=(e+Math.random()*16)%16|0;return e=Math.floor(e/16),(t===`x`?n:n&3|8).toString(16)})};Object.getPrototypeOf(async function(){}).constructor;var te=e=>`${e?.plugin_api_name??``}-${e?.id??``}-${e?.api_name??``}-${e?.script_id??``}`,D=e=>typeof e==`object`&&!!e&&`__kzConsole`in e,O=/^\/(.*)\/([dgimsuvy]*)$/,k=e=>{try{if(typeof e!=`object`||!e)return e;if(Array.isArray(e))return e.map(k);if(D(e))switch(e.__kzConsole){case`undefined`:return;case`bigint`:try{return BigInt(e.value)}catch{return e.value}case`symbol`:return e.value;case`function`:return`[Function: ${e.name}]`;case`error`:{let t=Error(e.message);return t.name=e.name,e.stack&&(t.stack=e.stack),t}case`date`:return new Date(e.value);case`regexp`:{let t=O.exec(e.value);if(!t)return e.value;try{return new RegExp(t[1]??``,t[2])}catch{return e.value}}case`circular`:return`[Circular]`;case`unserializable`:return`[Unserializable: ${e.reason}]`}let t={};for(let[n,r]of Object.entries(e))t[n]=k(r);return t}catch{return`[Unserializable]`}},A=class e extends Error{proxyStatus;upstreamStatus;upstreamResponse;constructor(t,n,r,i){super(i??r?.error?.message??(n?`Request failed with status code ${String(n)}`:`Request failed with proxy status code ${String(t)}`)),this.name=`KizenRequestError`,this.proxyStatus=t,this.upstreamStatus=n,this.upstreamResponse=r,Object.setPrototypeOf(this,e.prototype)}},ne=`__kizen__action__`,re=`__kizen__actionmenu__`,j=e=>`${ne}${e}`,M=e=>`${re}${e}`,N=(e,t)=>`${M(e)}_${t}`,ie=e=>e.startsWith(re),P=e=>e.startsWith(ne),F=e=>{if(!ie(e))return{actionApiName:``,objectId:``};let t=e.slice(re.length),n=t.lastIndexOf(`_`);return n===-1?{actionApiName:``,objectId:``}:{actionApiName:t.slice(0,n),objectId:t.slice(n+1)}},I=e=>({key:j(e.api_name),type:`custom_object`,label:e.name,allow_multiple:!0}),ae=[`description`,`container`,`qr`,`image`,`link`],L=(e,t)=>{let n=(e.fields??[]).filter(e=>!ae.includes(e.type)).map(e=>({...e,when:t?`(${t}) && (${e.when??`true`})`:e.when})),r=(e.fields??[]).filter(e=>e.type===`container`).flatMap(e=>L(e,e.when)),i=e.actions?.filter(e=>e.hint_object_name)??[];return[...n,...r,...i.map(e=>({...I(e),match_hint:e.hint_object_name??``}))]},oe=(e,t)=>{let n=L(e).reduce((e,t)=>({...e,[t.key]:t}),{}),r=Object.keys(t),i={};return r.forEach(e=>{let r=t[e],a=n[e];if(a?.type){switch(a.type){case`boolean`:let t=r;if(!t)return;i[e]=t.value;return;case`custom_object`:{let t=r;if(!t)return;i[e]={objectId:t.value?.id,objectName:t.value?.objectName};return}case`field`:{let t=r;if(!t?.value)return;Array.isArray(t.value)?i[e]=t.value.map(e=>({fieldId:e.value,fieldName:e.label,objectId:t.associatedObject?.id,objectName:t.associatedObject?.name})):typeof t.value==`object`&&typeof t.associatedObject==`object`&&(i[e]={fieldId:t.value.value,fieldName:t.value.label,objectId:t.associatedObject.id,objectName:t.associatedObject.name});return}case`number`:{let t=r;if(!t)return;try{let n=Number(t.value);if(!n&&n!==0)return;i[e]=n}catch{i[e]=NaN}return}case`select`:{let t=r;if(!t)return;i[e]=t.value;return}case`radio`:{let t=r;if(!t?.value)return;i[e]=t.value;return}case`text`:{let t=r?.value;if(t){i[e]=t;return}let n=a.default;n&&(i[e]=n);return}case`description`:case`container`:case`qr`:case`image`:case`link`:case`api_key`:return}return r?.value}}),i},se=`plugin-assets.kizen.dev`,R=`plugin-assets.kizen.com`,ce=[se,R],le=``,ue=le!==``,de=e=>ue&&e===le||ce.some(t=>e===`https://${t}`),fe=e=>{try{return de(new URL(e).origin)}catch{return!1}},pe=e=>{let t=e.data;if(!de(e.origin))return{handled:!0,data:t};let n=t;return typeof t!=`object`||!t||n.event!==`message`?{handled:!1}:{handled:!0,data:n.data}},z=[`microphone`,`speaker-selection`,`autoplay`,`camera`,`display-capture`,`hid`],me=[`allow-popups`,`allow-scripts`,`allow-same-origin`],he={useDevMode:!1,__dangerouslySkipProxy:!1},B=(e,t=he,n=``)=>{let{useDevMode:r,__dangerouslySkipProxy:i}=t,a=``;if(i)a=e;else try{a=de(new URL(e).origin)?e:`${ue?le:`https://${r?se:R}`}?url=${encodeURIComponent(e)}&allow=${encodeURIComponent(n)}`}catch(t){console.warn(`Failed to parse URL: ${e}. Apps should not attempt to display invalid URLs. Error: ${t.message}`),a=``}let o=fe(a);return{url:a,isUsingProxy:o}},ge=e=>e.filter(e=>z.some(t=>e.startsWith(t))),_e=e=>e.filter(e=>me.includes(e)),ve=()=>z.map(e=>`${e} *`).join(`; `),ye=Object.create,be=Object.defineProperty,xe=Object.getOwnPropertyDescriptor,Se=Object.getOwnPropertyNames,Ce=Object.getPrototypeOf,V=Object.prototype.hasOwnProperty,H=(e,t)=>function(){return t||(0,e[Se(e)[0]])((t={exports:{}}).exports,t),t.exports},we=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of Se(t))!V.call(e,i)&&i!==n&&be(e,i,{get:()=>t[i],enumerable:!(r=xe(t,i))||r.enumerable});return e},Te=(e,t,n)=>(n=e==null?{}:ye(Ce(e)),we(t||!e||!e.__esModule?be(n,`default`,{value:e,enumerable:!0}):n,e));function Ee(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function De(e){if(Array.isArray(e))return e}function Oe(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function ke(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function U(e,t){return De(e)||Oe(e,t)||Ae(e,t)||ke()}function Ae(e,t){if(e){if(typeof e==`string`)return Ee(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ee(e,t):void 0}}var je=Object.entries,Me=Object.setPrototypeOf,Ne=Object.isFrozen,Pe=Object.getPrototypeOf,Fe=Object.getOwnPropertyDescriptor,W=Object.freeze,G=Object.seal,Ie=Object.create,Le=typeof Reflect<`u`&&Reflect,Re=Le.apply,ze=Le.construct;W||=function(e){return e},G||=function(e){return e},Re||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},ze||=function(e){return new e(...[...arguments].slice(1))};var Be=X(Array.prototype.forEach),Ve=X(Array.prototype.lastIndexOf),He=X(Array.prototype.pop),Ue=X(Array.prototype.push),We=X(Array.prototype.splice),K=Array.isArray,Ge=X(String.prototype.toLowerCase),Ke=X(String.prototype.toString),qe=X(String.prototype.match),Je=X(String.prototype.replace),Ye=X(String.prototype.indexOf),Xe=X(String.prototype.trim),q=X(Number.prototype.toString),Ze=X(Boolean.prototype.toString),Qe=typeof BigInt>`u`?null:X(BigInt.prototype.toString),$e=typeof Symbol>`u`?null:X(Symbol.prototype.toString),J=X(Object.prototype.hasOwnProperty),et=X(Object.prototype.toString),Y=X(RegExp.prototype.test),tt=nt(TypeError);function X(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return Re(e,t,n)}}function nt(e){return function(){return ze(e,[...arguments])}}function Z(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ge;if(Me&&Me(e,null),!K(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(Ne(t)||(t[r]=e),i=e)}e[i]=!0}return e}function rt(e){for(let t=0;t<e.length;t++)J(e,t)||(e[t]=null);return e}function Q(e){let t=Ie(null);for(let r of je(e)){var n=U(r,2);let i=n[0],a=n[1];J(e,i)&&(K(a)?t[i]=rt(a):a&&typeof a==`object`&&a.constructor===Object?t[i]=Q(a):t[i]=a)}return t}function it(e){switch(typeof e){case`string`:return e;case`number`:return q(e);case`boolean`:return Ze(e);case`bigint`:return Qe?Qe(e):`0`;case`symbol`:return $e?$e(e):`Symbol()`;case`undefined`:return et(e);case`function`:case`object`:{if(e===null)return et(e);let t=e,n=at(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:et(e)}return et(e)}default:return et(e)}}function at(e,t){for(;e!==null;){let n=Fe(e,t);if(n){if(n.get)return X(n.get);if(typeof n.value==`function`)return X(n.value)}e=Pe(e)}function n(){return null}return n}function ot(e){try{return Y(e,``),!0}catch{return!1}}var st=W(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),ct=W(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),lt=W([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),ut=W([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),dt=W(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),ft=W([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),pt=W([`#text`]),mt=W(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),ht=W(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-rendering.textlength.type.u1.u2.unicode.values.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),gt=W(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),_t=W([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),vt=G(/{{[\w\W]*|^[\w\W]*}}/g),yt=G(/<%[\w\W]*|^[\w\W]*%>/g),bt=G(/\${[\w\W]*/g),xt=G(/^data-[\-\w.\u00B7-\uFFFF]+$/),St=G(/^aria-[\-\w]+$/),Ct=G(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),wt=G(/^(?:\w+script|data):/i),Tt=G(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Et=G(/^html$/i),Dt=G(/^[a-z][.\w]*(-[.\w]+)+$/i),Ot={element:1,text:3,progressingInstruction:7,comment:8,document:9},kt=function(){return typeof window>`u`?null:window},At=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},jt=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Mt(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:kt(),t=e=>Mt(e);if(t.version=`3.4.3`,t.removed=[],!e||!e.document||e.document.nodeType!==Ot.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript,a=e.DocumentFragment,o=e.HTMLTemplateElement,s=e.Node,c=e.Element,l=e.NodeFilter,u=e.NamedNodeMap,d=u===void 0?e.NamedNodeMap||e.MozNamedAttrMap:u,f=e.HTMLFormElement,p=e.DOMParser,m=e.trustedTypes,h=c.prototype,g=at(h,`cloneNode`),_=at(h,`remove`),v=at(h,`nextSibling`),y=at(h,`childNodes`),b=at(h,`parentNode`);if(typeof o==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let x,S=``,C=n,w=C.implementation,T=C.createNodeIterator,E=C.createDocumentFragment,ee=C.getElementsByTagName,te=r.importNode,D=jt();t.isSupported=typeof je==`function`&&typeof b==`function`&&w&&w.createHTMLDocument!==void 0;let O=vt,k=yt,A=bt,ne=xt,re=St,j=wt,M=Tt,N=Dt,ie=Ct,P=null,F=Z({},[...st,...ct,...lt,...dt,...pt]),I=null,ae=Z({},[...mt,...ht,...gt,..._t]),L=Object.seal(Ie(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),oe=null,se=null,R=Object.seal(Ie(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),ce=!0,le=!0,ue=!1,de=!0,fe=!1,pe=!0,z=!1,me=!1,he=!1,B=!1,ge=!1,_e=!1,ve=!0,ye=!1,be=`user-content-`,xe=!0,Se=!1,Ce={},V=null,H=Z({},[`annotation-xml`,`audio`,`colgroup`,`desc`,`foreignobject`,`head`,`iframe`,`math`,`mi`,`mn`,`mo`,`ms`,`mtext`,`noembed`,`noframes`,`noscript`,`plaintext`,`script`,`style`,`svg`,`template`,`thead`,`title`,`video`,`xmp`]),we=null,Te=Z({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Ee=null,De=Z({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Oe=`http://www.w3.org/1998/Math/MathML`,ke=`http://www.w3.org/2000/svg`,U=`http://www.w3.org/1999/xhtml`,Ae=U,Me=!1,Ne=null,Pe=Z({},[Oe,ke,U],Ke),Fe=Z({},[`mi`,`mo`,`mn`,`ms`,`mtext`]),G=Z({},[`annotation-xml`]),Le=Z({},[`title`,`style`,`font`,`a`,`script`]),Re=null,ze=[`application/xhtml+xml`,`text/html`],q=null,Ze=null,Qe=n.createElement(`form`),$e=function(e){return e instanceof RegExp||e instanceof Function},et=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Ze&&Ze===e)return;(!e||typeof e!=`object`)&&(e={}),e=Q(e),Re=ze.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,q=Re===`application/xhtml+xml`?Ke:Ge,P=J(e,`ALLOWED_TAGS`)&&K(e.ALLOWED_TAGS)?Z({},e.ALLOWED_TAGS,q):F,I=J(e,`ALLOWED_ATTR`)&&K(e.ALLOWED_ATTR)?Z({},e.ALLOWED_ATTR,q):ae,Ne=J(e,`ALLOWED_NAMESPACES`)&&K(e.ALLOWED_NAMESPACES)?Z({},e.ALLOWED_NAMESPACES,Ke):Pe,Ee=J(e,`ADD_URI_SAFE_ATTR`)&&K(e.ADD_URI_SAFE_ATTR)?Z(Q(De),e.ADD_URI_SAFE_ATTR,q):De,we=J(e,`ADD_DATA_URI_TAGS`)&&K(e.ADD_DATA_URI_TAGS)?Z(Q(Te),e.ADD_DATA_URI_TAGS,q):Te,V=J(e,`FORBID_CONTENTS`)&&K(e.FORBID_CONTENTS)?Z({},e.FORBID_CONTENTS,q):H,oe=J(e,`FORBID_TAGS`)&&K(e.FORBID_TAGS)?Z({},e.FORBID_TAGS,q):Q({}),se=J(e,`FORBID_ATTR`)&&K(e.FORBID_ATTR)?Z({},e.FORBID_ATTR,q):Q({}),Ce=J(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?Q(e.USE_PROFILES):e.USE_PROFILES:!1,ce=e.ALLOW_ARIA_ATTR!==!1,le=e.ALLOW_DATA_ATTR!==!1,ue=e.ALLOW_UNKNOWN_PROTOCOLS||!1,de=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,fe=e.SAFE_FOR_TEMPLATES||!1,pe=e.SAFE_FOR_XML!==!1,z=e.WHOLE_DOCUMENT||!1,B=e.RETURN_DOM||!1,ge=e.RETURN_DOM_FRAGMENT||!1,_e=e.RETURN_TRUSTED_TYPE||!1,he=e.FORCE_BODY||!1,ve=e.SANITIZE_DOM!==!1,ye=e.SANITIZE_NAMED_PROPS||!1,xe=e.KEEP_CONTENT!==!1,Se=e.IN_PLACE||!1,ie=ot(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:Ct,Ae=typeof e.NAMESPACE==`string`?e.NAMESPACE:U,Fe=J(e,`MATHML_TEXT_INTEGRATION_POINTS`)&&e.MATHML_TEXT_INTEGRATION_POINTS&&typeof e.MATHML_TEXT_INTEGRATION_POINTS==`object`?Q(e.MATHML_TEXT_INTEGRATION_POINTS):Z({},[`mi`,`mo`,`mn`,`ms`,`mtext`]),G=J(e,`HTML_INTEGRATION_POINTS`)&&e.HTML_INTEGRATION_POINTS&&typeof e.HTML_INTEGRATION_POINTS==`object`?Q(e.HTML_INTEGRATION_POINTS):Z({},[`annotation-xml`]);let t=J(e,`CUSTOM_ELEMENT_HANDLING`)&&e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING==`object`?Q(e.CUSTOM_ELEMENT_HANDLING):Ie(null);if(L=Ie(null),J(t,`tagNameCheck`)&&$e(t.tagNameCheck)&&(L.tagNameCheck=t.tagNameCheck),J(t,`attributeNameCheck`)&&$e(t.attributeNameCheck)&&(L.attributeNameCheck=t.attributeNameCheck),J(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(L.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),fe&&(le=!1),ge&&(B=!0),Ce&&(P=Z({},pt),I=Ie(null),Ce.html===!0&&(Z(P,st),Z(I,mt)),Ce.svg===!0&&(Z(P,ct),Z(I,ht),Z(I,_t)),Ce.svgFilters===!0&&(Z(P,lt),Z(I,ht),Z(I,_t)),Ce.mathMl===!0&&(Z(P,dt),Z(I,gt),Z(I,_t))),R.tagCheck=null,R.attributeCheck=null,J(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?R.tagCheck=e.ADD_TAGS:K(e.ADD_TAGS)&&(P===F&&(P=Q(P)),Z(P,e.ADD_TAGS,q))),J(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?R.attributeCheck=e.ADD_ATTR:K(e.ADD_ATTR)&&(I===ae&&(I=Q(I)),Z(I,e.ADD_ATTR,q))),J(e,`ADD_URI_SAFE_ATTR`)&&K(e.ADD_URI_SAFE_ATTR)&&Z(Ee,e.ADD_URI_SAFE_ATTR,q),J(e,`FORBID_CONTENTS`)&&K(e.FORBID_CONTENTS)&&(V===H&&(V=Q(V)),Z(V,e.FORBID_CONTENTS,q)),J(e,`ADD_FORBID_CONTENTS`)&&K(e.ADD_FORBID_CONTENTS)&&(V===H&&(V=Q(V)),Z(V,e.ADD_FORBID_CONTENTS,q)),xe&&(P[`#text`]=!0),z&&Z(P,[`html`,`head`,`body`]),P.table&&(Z(P,[`tbody`]),delete oe.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw tt(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw tt(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);x=e.TRUSTED_TYPES_POLICY,S=x.createHTML(``)}else x===void 0&&(x=At(m,i)),x!==null&&typeof S==`string`&&(S=x.createHTML(``));W&&W(e),Ze=e},X=Z({},[...ct,...lt,...ut]),nt=Z({},[...dt,...ft]),rt=function(e){let t=b(e);(!t||!t.tagName)&&(t={namespaceURI:Ae,tagName:`template`});let n=Ge(e.tagName),r=Ge(t.tagName);return Ne[e.namespaceURI]?e.namespaceURI===ke?t.namespaceURI===U?n===`svg`:t.namespaceURI===Oe?n===`svg`&&(r===`annotation-xml`||Fe[r]):!!X[n]:e.namespaceURI===Oe?t.namespaceURI===U?n===`math`:t.namespaceURI===ke?n===`math`&&G[r]:!!nt[n]:e.namespaceURI===U?t.namespaceURI===ke&&!G[r]||t.namespaceURI===Oe&&!Fe[r]?!1:!nt[n]&&(Le[n]||!X[n]):!!(Re===`application/xhtml+xml`&&Ne[e.namespaceURI]):!1},Nt=function(e){Ue(t.removed,{element:e});try{b(e).removeChild(e)}catch{_(e)}},Pt=function(e,n){try{Ue(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch{Ue(t.removed,{attribute:null,from:n})}if(n.removeAttribute(e),e===`is`)if(B||ge)try{Nt(n)}catch{}else try{n.setAttribute(e,``)}catch{}},Ft=function(e){let t=null,r=null;if(he)e=`<remove></remove>`+e;else{let t=qe(e,/^[\r\n\t ]+/);r=t&&t[0]}Re===`application/xhtml+xml`&&Ae===U&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=x?x.createHTML(e):e;if(Ae===U)try{t=new p().parseFromString(i,Re)}catch{}if(!t||!t.documentElement){t=w.createDocument(Ae,`template`,null);try{t.documentElement.innerHTML=Me?S:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Ae===U?ee.call(t,z?`html`:`body`)[0]:z?t.documentElement:a},It=function(e){return T.call(e.ownerDocument||e,e,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},Lt=function(e){return e instanceof f&&(typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||!(e.attributes instanceof d)||typeof e.removeAttribute!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`)},Rt=function(e){return typeof s==`function`&&e instanceof s};function $(e,n,r){Be(e,e=>{e.call(t,n,r,Ze)})}let zt=function(e){let n=null;if($(D.beforeSanitizeElements,e,null),Lt(e))return Nt(e),!0;let r=q(e.nodeName);if($(D.uponSanitizeElement,e,{tagName:r,allowedTags:P}),pe&&e.hasChildNodes()&&!Rt(e.firstElementChild)&&Y(/<[/\w!]/g,e.innerHTML)&&Y(/<[/\w!]/g,e.textContent)||pe&&e.namespaceURI===U&&r===`style`&&Rt(e.firstElementChild)||e.nodeType===Ot.progressingInstruction||pe&&e.nodeType===Ot.comment&&Y(/<[/\w]/g,e.data))return Nt(e),!0;if(oe[r]||!(R.tagCheck instanceof Function&&R.tagCheck(r))&&!P[r]){if(!oe[r]&&Ht(r)&&(L.tagNameCheck instanceof RegExp&&Y(L.tagNameCheck,r)||L.tagNameCheck instanceof Function&&L.tagNameCheck(r)))return!1;if(xe&&!V[r]){let t=b(e)||e.parentNode,n=y(e)||e.childNodes;if(n&&t){let r=n.length;for(let i=r-1;i>=0;--i){let r=g(n[i],!0);t.insertBefore(r,v(e))}}}return Nt(e),!0}return e instanceof c&&!rt(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&Y(/<\/no(script|embed|frames)/i,e.innerHTML)?(Nt(e),!0):(fe&&e.nodeType===Ot.text&&(n=e.textContent,Be([O,k,A],e=>{n=Je(n,e,` `)}),e.textContent!==n&&(Ue(t.removed,{element:e.cloneNode()}),e.textContent=n)),$(D.afterSanitizeElements,e,null),!1)},Bt=function(e,t,r){if(se[t]||ve&&(t===`id`||t===`name`)&&(r in n||r in Qe))return!1;let i=I[t]||R.attributeCheck instanceof Function&&R.attributeCheck(t,e);if(!(le&&!se[t]&&Y(ne,t))&&!(ce&&Y(re,t))){if(!i||se[t]){if(!(Ht(e)&&(L.tagNameCheck instanceof RegExp&&Y(L.tagNameCheck,e)||L.tagNameCheck instanceof Function&&L.tagNameCheck(e))&&(L.attributeNameCheck instanceof RegExp&&Y(L.attributeNameCheck,t)||L.attributeNameCheck instanceof Function&&L.attributeNameCheck(t,e))||t===`is`&&L.allowCustomizedBuiltInElements&&(L.tagNameCheck instanceof RegExp&&Y(L.tagNameCheck,r)||L.tagNameCheck instanceof Function&&L.tagNameCheck(r))))return!1}else if(!Ee[t]&&!Y(ie,Je(r,M,``))&&!((t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&Ye(r,`data:`)===0&&we[e])&&!(ue&&!Y(j,Je(r,M,``)))&&r)return!1}return!0},Vt=Z({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),Ht=function(e){return!Vt[Ge(e)]&&Y(N,e)},Ut=function(e){$(D.beforeSanitizeAttributes,e,null);let n=e.attributes;if(!n||Lt(e))return;let r={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:I,forceKeepAttr:void 0},i=n.length;for(;i--;){let a=n[i],o=a.name,s=a.namespaceURI,c=a.value,l=q(o),u=c,d=o===`value`?u:Xe(u);if(r.attrName=l,r.attrValue=d,r.keepAttr=!0,r.forceKeepAttr=void 0,$(D.uponSanitizeAttribute,e,r),d=r.attrValue,ye&&(l===`id`||l===`name`)&&Ye(d,be)!==0&&(Pt(o,e),d=be+d),pe&&Y(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,d)){Pt(o,e);continue}if(l===`attributename`&&qe(d,`href`)){Pt(o,e);continue}if(r.forceKeepAttr)continue;if(!r.keepAttr){Pt(o,e);continue}if(!de&&Y(/\/>/i,d)){Pt(o,e);continue}fe&&Be([O,k,A],e=>{d=Je(d,e,` `)});let f=q(e.nodeName);if(!Bt(f,l,d)){Pt(o,e);continue}if(x&&typeof m==`object`&&typeof m.getAttributeType==`function`&&!s)switch(m.getAttributeType(f,l)){case`TrustedHTML`:d=x.createHTML(d);break;case`TrustedScriptURL`:d=x.createScriptURL(d);break}if(d!==u)try{s?e.setAttributeNS(s,o,d):e.setAttribute(o,d),Lt(e)?Nt(e):He(t.removed)}catch{Pt(o,e)}}$(D.afterSanitizeAttributes,e,null)},Wt=function(e){let t=null,n=It(e);for($(D.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)$(D.uponSanitizeShadowNode,t,null),zt(t),Ut(t),t.content instanceof a&&Wt(t.content);$(D.afterSanitizeShadowDOM,e,null)},Gt=function(e){if(e.nodeType===Ot.element&&e.shadowRoot instanceof a){let t=e.shadowRoot;Gt(t),Wt(t)}let t=e.childNodes;if(!t)return;let n=[];Be(t,e=>{Ue(n,e)});for(let e of n)Gt(e)};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,o=null,c=null,l=null;if(Me=!e,Me&&(e=`<!-->`),typeof e!=`string`&&!Rt(e)&&(e=it(e),typeof e!=`string`))throw tt(`dirty is not a string, aborting`);if(!t.isSupported)return e;if(me||et(n),t.removed=[],typeof e==`string`&&(Se=!1),Se){let t=e.nodeName;if(typeof t==`string`){let e=q(t);if(!P[e]||oe[e])throw tt(`root node is forbidden and cannot be sanitized in-place`)}Gt(e)}else if(e instanceof s)i=Ft(`<!---->`),o=i.ownerDocument.importNode(e,!0),o.nodeType===Ot.element&&o.nodeName===`BODY`||o.nodeName===`HTML`?i=o:i.appendChild(o),Gt(o);else{if(!B&&!fe&&!z&&e.indexOf(`<`)===-1)return x&&_e?x.createHTML(e):e;if(i=Ft(e),!i)return B?null:_e?S:``}i&&he&&Nt(i.firstChild);let u=It(Se?e:i);for(;c=u.nextNode();)zt(c),Ut(c),c.content instanceof a&&Wt(c.content);if(Se)return e;if(B){if(fe){i.normalize();let e=i.innerHTML;Be([O,k,A],t=>{e=Je(e,t,` `)}),i.innerHTML=e}if(ge)for(l=E.call(i.ownerDocument);i.firstChild;)l.appendChild(i.firstChild);else l=i;return(I.shadowroot||I.shadowrootmode)&&(l=te.call(r,l,!0)),l}let d=z?i.outerHTML:i.innerHTML;return z&&P[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&Y(Et,i.ownerDocument.doctype.name)&&(d=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
|
|
3
|
-
`+d),fe&&Be([O,k,A],e=>{d=Je(d,e,` `)}),x&&_e?x.createHTML(d):d},t.setConfig=function(){et(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}),me=!0},t.clearConfig=function(){Ze=null,me=!1},t.isValidAttribute=function(e,t,n){return Ze||et({}),Bt(q(e),q(t),n)},t.addHook=function(e,t){typeof t==`function`&&Ue(D[e],t)},t.removeHook=function(e,t){if(t!==void 0){let n=Ve(D[e],t);return n===-1?void 0:We(D[e],n,1)[0]}return He(D[e])},t.removeHooks=function(e){D[e]=[]},t.removeAllHooks=function(){D=jt()},t}var Nt=Mt(),Pt=H({"node_modules/.pnpm/jsonify@0.0.1/node_modules/jsonify/lib/parse.js"(e,t){var n,r,i={'"':`"`,"\\":`\\`,"/":`/`,b:`\b`,f:`\f`,n:`
|
|
4
|
-
`,r:`\r`,t:` `},a;function o(e){throw{name:`SyntaxError`,message:e,at:n,text:a}}function s(e){return e&&e!==r&&o(`Expected '`+e+`' instead of '`+r+`'`),r=a.charAt(n),n+=1,r}function c(){var e,t=``;for(r===`-`&&(t=`-`,s(`-`));r>=`0`&&r<=`9`;)t+=r,s();if(r===`.`)for(t+=`.`;s()&&r>=`0`&&r<=`9`;)t+=r;if(r===`e`||r===`E`)for(t+=r,s(),(r===`-`||r===`+`)&&(t+=r,s());r>=`0`&&r<=`9`;)t+=r,s();return e=Number(t),isFinite(e)||o(`Bad number`),e}function l(){var e,t,n=``,a;if(r===`"`)for(;s();)if(r===`"`)return s(),n;else if(r===`\\`)if(s(),r===`u`){for(a=0,t=0;t<4&&(e=parseInt(s(),16),isFinite(e));t+=1)a=a*16+e;n+=String.fromCharCode(a)}else if(typeof i[r]==`string`)n+=i[r];else break;else n+=r;o(`Bad string`)}function u(){for(;r&&r<=` `;)s()}function d(){switch(r){case`t`:return s(`t`),s(`r`),s(`u`),s(`e`),!0;case`f`:return s(`f`),s(`a`),s(`l`),s(`s`),s(`e`),!1;case`n`:return s(`n`),s(`u`),s(`l`),s(`l`),null;default:o(`Unexpected '`+r+`'`)}}function f(){var e=[];if(r===`[`){if(s(`[`),u(),r===`]`)return s(`]`),e;for(;r;){if(e.push(m()),u(),r===`]`)return s(`]`),e;s(`,`),u()}}o(`Bad array`)}function p(){var e,t={};if(r===`{`){if(s(`{`),u(),r===`}`)return s(`}`),t;for(;r;){if(e=l(),u(),s(`:`),Object.prototype.hasOwnProperty.call(t,e)&&o(`Duplicate key "`+e+`"`),t[e]=m(),u(),r===`}`)return s(`}`),t;s(`,`),u()}}o(`Bad object`)}function m(){switch(u(),r){case`{`:return p();case`[`:return f();case`"`:return l();case`-`:return c();default:return r>=`0`&&r<=`9`?c():d()}}t.exports=function(e,t){var i;return a=e,n=0,r=` `,i=m(),u(),r&&o(`Syntax error`),typeof t==`function`?(function e(n,r){var i,a,o=n[r];if(o&&typeof o==`object`)for(i in m)Object.prototype.hasOwnProperty.call(o,i)&&(a=e(o,i),a===void 0?delete o[i]:o[i]=a);return t.call(n,r,o)})({"":i},``):i}}}),Ft=H({"node_modules/.pnpm/jsonify@0.0.1/node_modules/jsonify/lib/stringify.js"(e,t){var n=/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,r,i,a={"\b":`\\b`," ":`\\t`,"\n":`\\n`,"\f":`\\f`,"\r":`\\r`,'"':`\\"`,"\\":`\\\\`},o;function s(e){return n.lastIndex=0,n.test(e)?`"`+e.replace(n,function(e){var t=a[e];return typeof t==`string`?t:`\\u`+(`0000`+e.charCodeAt(0).toString(16)).slice(-4)})+`"`:`"`+e+`"`}function c(e,t){var n,a,l,u,d=r,f,p=t[e];switch(p&&typeof p==`object`&&typeof p.toJSON==`function`&&(p=p.toJSON(e)),typeof o==`function`&&(p=o.call(t,e,p)),typeof p){case`string`:return s(p);case`number`:return isFinite(p)?String(p):`null`;case`boolean`:case`null`:return String(p);case`object`:if(!p)return`null`;if(r+=i,f=[],Object.prototype.toString.apply(p)===`[object Array]`){for(u=p.length,n=0;n<u;n+=1)f[n]=c(n,p)||`null`;return l=f.length===0?`[]`:r?`[
|
|
5
|
-
`+r+f.join(`,
|
|
6
|
-
`+r)+`
|
|
7
|
-
`+d+`]`:`[`+f.join(`,`)+`]`,r=d,l}if(o&&typeof o==`object`)for(u=o.length,n=0;n<u;n+=1)a=o[n],typeof a==`string`&&(l=c(a,p),l&&f.push(s(a)+(r?`: `:`:`)+l));else for(a in p)Object.prototype.hasOwnProperty.call(p,a)&&(l=c(a,p),l&&f.push(s(a)+(r?`: `:`:`)+l));return l=f.length===0?`{}`:r?`{
|
|
8
|
-
`+r+f.join(`,
|
|
9
|
-
`+r)+`
|
|
10
|
-
`+d+`}`:`{`+f.join(`,`)+`}`,r=d,l}}t.exports=function(e,t,n){var a;if(r=``,i=``,typeof n==`number`)for(a=0;a<n;a+=1)i+=` `;else typeof n==`string`&&(i=n);if(o=t,t&&typeof t!=`function`&&(typeof t!=`object`||typeof t.length!=`number`))throw Error(`JSON.stringify`);return c(``,{"":e})}}}),It=H({"node_modules/.pnpm/jsonify@0.0.1/node_modules/jsonify/index.js"(e){e.parse=Pt(),e.stringify=Ft()}}),Lt=H({"node_modules/.pnpm/isarray@2.0.5/node_modules/isarray/index.js"(e,t){var n={}.toString;t.exports=Array.isArray||function(e){return n.call(e)==`[object Array]`}}}),Rt=H({"node_modules/.pnpm/object-keys@1.1.1/node_modules/object-keys/isArguments.js"(e,t){var n=Object.prototype.toString;t.exports=function(e){var t=n.call(e),r=t===`[object Arguments]`;return r||=t!==`[object Array]`&&typeof e==`object`&&!!e&&typeof e.length==`number`&&e.length>=0&&n.call(e.callee)===`[object Function]`,r}}}),$=H({"node_modules/.pnpm/object-keys@1.1.1/node_modules/object-keys/implementation.js"(e,t){var n;Object.keys||(r=Object.prototype.hasOwnProperty,i=Object.prototype.toString,a=Rt(),o=Object.prototype.propertyIsEnumerable,s=!o.call({toString:null},`toString`),c=o.call(function(){},`prototype`),l=[`toString`,`toLocaleString`,`valueOf`,`hasOwnProperty`,`isPrototypeOf`,`propertyIsEnumerable`,`constructor`],u=function(e){var t=e.constructor;return t&&t.prototype===e},d={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},f=(function(){if(typeof window>`u`)return!1;for(var e in window)try{if(!d[`$`+e]&&r.call(window,e)&&window[e]!==null&&typeof window[e]==`object`)try{u(window[e])}catch{return!0}}catch{return!0}return!1})(),p=function(e){if(typeof window>`u`||!f)return u(e);try{return u(e)}catch{return!1}},n=function(e){var t=typeof e==`object`&&!!e,n=i.call(e)===`[object Function]`,o=a(e),u=t&&i.call(e)===`[object String]`,d=[];if(!t&&!n&&!o)throw TypeError(`Object.keys called on a non-object`);var f=c&&n;if(u&&e.length>0&&!r.call(e,0))for(var m=0;m<e.length;++m)d.push(String(m));if(o&&e.length>0)for(var h=0;h<e.length;++h)d.push(String(h));else for(var g in e)!(f&&g===`prototype`)&&r.call(e,g)&&d.push(String(g));if(s)for(var _=p(e),v=0;v<l.length;++v)!(_&&l[v]===`constructor`)&&r.call(e,l[v])&&d.push(l[v]);return d});var r,i,a,o,s,c,l,u,d,f,p;t.exports=n}}),zt=H({"node_modules/.pnpm/object-keys@1.1.1/node_modules/object-keys/index.js"(e,t){var n=Array.prototype.slice,r=Rt(),i=Object.keys,a=i?function(e){return i(e)}:$(),o=Object.keys;a.shim=function(){return Object.keys?(function(){var e=Object.keys(arguments);return e&&e.length===arguments.length})(1,2)||(Object.keys=function(e){return r(e)?o(n.call(e)):o(e)}):Object.keys=a,Object.keys||a},t.exports=a}}),Bt=H({"node_modules/.pnpm/es-object-atoms@1.1.1/node_modules/es-object-atoms/index.js"(e,t){t.exports=Object}}),Vt=H({"node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/index.js"(e,t){t.exports=Error}}),Ht=H({"node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/eval.js"(e,t){t.exports=EvalError}}),Ut=H({"node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/range.js"(e,t){t.exports=RangeError}}),Wt=H({"node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/ref.js"(e,t){t.exports=ReferenceError}}),Gt=H({"node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/syntax.js"(e,t){t.exports=SyntaxError}}),Kt=H({"node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/type.js"(e,t){t.exports=TypeError}}),qt=H({"node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/uri.js"(e,t){t.exports=URIError}}),Jt=H({"node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/abs.js"(e,t){t.exports=Math.abs}}),Yt=H({"node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/floor.js"(e,t){t.exports=Math.floor}}),Xt=H({"node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/max.js"(e,t){t.exports=Math.max}}),Zt=H({"node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/min.js"(e,t){t.exports=Math.min}}),Qt=H({"node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/pow.js"(e,t){t.exports=Math.pow}}),$t=H({"node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/round.js"(e,t){t.exports=Math.round}}),en=H({"node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/isNaN.js"(e,t){t.exports=Number.isNaN||function(e){return e!==e}}}),tn=H({"node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/sign.js"(e,t){var n=en();t.exports=function(e){return n(e)||e===0?e:e<0?-1:1}}}),nn=H({"node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/gOPD.js"(e,t){t.exports=Object.getOwnPropertyDescriptor}}),rn=H({"node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/index.js"(e,t){var n=nn();if(n)try{n([],`length`)}catch{n=null}t.exports=n}}),an=H({"node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/index.js"(e,t){var n=Object.defineProperty||!1;if(n)try{n({},`a`,{value:1})}catch{n=!1}t.exports=n}}),on=H({"node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/shams.js"(e,t){t.exports=function(){if(typeof Symbol!=`function`||typeof Object.getOwnPropertySymbols!=`function`)return!1;if(typeof Symbol.iterator==`symbol`)return!0;var e={},t=Symbol(`test`),n=Object(t);if(typeof t==`string`||Object.prototype.toString.call(t)!==`[object Symbol]`||Object.prototype.toString.call(n)!==`[object Symbol]`)return!1;var r=42;for(var i in e[t]=r,e)return!1;if(typeof Object.keys==`function`&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames==`function`&&Object.getOwnPropertyNames(e).length!==0)return!1;var a=Object.getOwnPropertySymbols(e);if(a.length!==1||a[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor==`function`){var o=Object.getOwnPropertyDescriptor(e,t);if(o.value!==r||o.enumerable!==!0)return!1}return!0}}}),sn=H({"node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/index.js"(e,t){var n=typeof Symbol<`u`&&Symbol,r=on();t.exports=function(){return typeof n!=`function`||typeof Symbol!=`function`||typeof n(`foo`)!=`symbol`||typeof Symbol(`bar`)!=`symbol`?!1:r()}}}),cn=H({"node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/Reflect.getPrototypeOf.js"(e,t){t.exports=typeof Reflect<`u`&&Reflect.getPrototypeOf||null}}),ln=H({"node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/Object.getPrototypeOf.js"(e,t){t.exports=Bt().getPrototypeOf||null}}),un=H({"node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/implementation.js"(e,t){var n=`Function.prototype.bind called on incompatible `,r=Object.prototype.toString,i=Math.max,a=`[object Function]`,o=function(e,t){for(var n=[],r=0;r<e.length;r+=1)n[r]=e[r];for(var i=0;i<t.length;i+=1)n[i+e.length]=t[i];return n},s=function(e,t){for(var n=[],r=t,i=0;r<e.length;r+=1,i+=1)n[i]=e[r];return n},c=function(e,t){for(var n=``,r=0;r<e.length;r+=1)n+=e[r],r+1<e.length&&(n+=t);return n};t.exports=function(e){var t=this;if(typeof t!=`function`||r.apply(t)!==a)throw TypeError(n+t);for(var l=s(arguments,1),u,d=function(){if(this instanceof u){var n=t.apply(this,o(l,arguments));return Object(n)===n?n:this}return t.apply(e,o(l,arguments))},f=i(0,t.length-l.length),p=[],m=0;m<f;m++)p[m]=`$`+m;if(u=Function(`binder`,`return function (`+c(p,`,`)+`){ return binder.apply(this,arguments); }`)(d),t.prototype){var h=function(){};h.prototype=t.prototype,u.prototype=new h,h.prototype=null}return u}}}),dn=H({"node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/index.js"(e,t){var n=un();t.exports=Function.prototype.bind||n}}),fn=H({"node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/functionCall.js"(e,t){t.exports=Function.prototype.call}}),pn=H({"node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/functionApply.js"(e,t){t.exports=Function.prototype.apply}}),mn=H({"node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/reflectApply.js"(e,t){t.exports=typeof Reflect<`u`&&Reflect&&Reflect.apply}}),hn=H({"node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/actualApply.js"(e,t){var n=dn(),r=pn(),i=fn();t.exports=mn()||n.call(i,r)}}),gn=H({"node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/index.js"(e,t){var n=dn(),r=Kt(),i=fn(),a=hn();t.exports=function(e){if(e.length<1||typeof e[0]!=`function`)throw new r(`a function is required`);return a(n,i,e)}}}),_n=H({"node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/get.js"(e,t){var n=gn(),r=rn(),i;try{i=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!=`object`||!(`code`in e)||e.code!==`ERR_PROTO_ACCESS`)throw e}var a=!!i&&r&&r(Object.prototype,`__proto__`),o=Object,s=o.getPrototypeOf;t.exports=a&&typeof a.get==`function`?n([a.get]):typeof s==`function`?(function(e){return s(e==null?e:o(e))}):!1}}),vn=H({"node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/index.js"(e,t){var n=cn(),r=ln(),i=_n();t.exports=n?function(e){return n(e)}:r?function(e){if(!e||typeof e!=`object`&&typeof e!=`function`)throw TypeError(`getProto: not an object`);return r(e)}:i?function(e){return i(e)}:null}}),yn=H({"node_modules/.pnpm/hasown@2.0.2/node_modules/hasown/index.js"(e,t){var n=Function.prototype.call,r=Object.prototype.hasOwnProperty;t.exports=dn().call(n,r)}}),bn=H({"node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/get-intrinsic/index.js"(e,t){var n,r=Bt(),i=Vt(),a=Ht(),o=Ut(),s=Wt(),c=Gt(),l=Kt(),u=qt(),d=Jt(),f=Yt(),p=Xt(),m=Zt(),h=Qt(),g=$t(),_=tn(),v=Function,y=function(e){try{return v(`"use strict"; return (`+e+`).constructor;`)()}catch{}},b=rn(),x=an(),S=function(){throw new l},C=b?(function(){try{return arguments.callee,S}catch{try{return b(arguments,`callee`).get}catch{return S}}})():S,w=sn()(),T=vn(),E=ln(),ee=cn(),te=pn(),D=fn(),O={},k=typeof Uint8Array>`u`||!T?n:T(Uint8Array),A={__proto__:null,"%AggregateError%":typeof AggregateError>`u`?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>`u`?n:ArrayBuffer,"%ArrayIteratorPrototype%":w&&T?T([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":O,"%AsyncGenerator%":O,"%AsyncGeneratorFunction%":O,"%AsyncIteratorPrototype%":O,"%Atomics%":typeof Atomics>`u`?n:Atomics,"%BigInt%":typeof BigInt>`u`?n:BigInt,"%BigInt64Array%":typeof BigInt64Array>`u`?n:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>`u`?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>`u`?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":i,"%eval%":eval,"%EvalError%":a,"%Float16Array%":typeof Float16Array>`u`?n:Float16Array,"%Float32Array%":typeof Float32Array>`u`?n:Float32Array,"%Float64Array%":typeof Float64Array>`u`?n:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>`u`?n:FinalizationRegistry,"%Function%":v,"%GeneratorFunction%":O,"%Int8Array%":typeof Int8Array>`u`?n:Int8Array,"%Int16Array%":typeof Int16Array>`u`?n:Int16Array,"%Int32Array%":typeof Int32Array>`u`?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":w&&T?T(T([][Symbol.iterator]())):n,"%JSON%":typeof JSON==`object`?JSON:n,"%Map%":typeof Map>`u`?n:Map,"%MapIteratorPrototype%":typeof Map>`u`||!w||!T?n:T(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":r,"%Object.getOwnPropertyDescriptor%":b,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>`u`?n:Promise,"%Proxy%":typeof Proxy>`u`?n:Proxy,"%RangeError%":o,"%ReferenceError%":s,"%Reflect%":typeof Reflect>`u`?n:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>`u`?n:Set,"%SetIteratorPrototype%":typeof Set>`u`||!w||!T?n:T(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>`u`?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":w&&T?T(``[Symbol.iterator]()):n,"%Symbol%":w?Symbol:n,"%SyntaxError%":c,"%ThrowTypeError%":C,"%TypedArray%":k,"%TypeError%":l,"%Uint8Array%":typeof Uint8Array>`u`?n:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>`u`?n:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>`u`?n:Uint16Array,"%Uint32Array%":typeof Uint32Array>`u`?n:Uint32Array,"%URIError%":u,"%WeakMap%":typeof WeakMap>`u`?n:WeakMap,"%WeakRef%":typeof WeakRef>`u`?n:WeakRef,"%WeakSet%":typeof WeakSet>`u`?n:WeakSet,"%Function.prototype.call%":D,"%Function.prototype.apply%":te,"%Object.defineProperty%":x,"%Object.getPrototypeOf%":E,"%Math.abs%":d,"%Math.floor%":f,"%Math.max%":p,"%Math.min%":m,"%Math.pow%":h,"%Math.round%":g,"%Math.sign%":_,"%Reflect.getPrototypeOf%":ee};if(T)try{null.error}catch(e){ne=T(T(e)),A[`%Error.prototype%`]=ne}var ne,re=function e(t){var n;if(t===`%AsyncFunction%`)n=y(`async function () {}`);else if(t===`%GeneratorFunction%`)n=y(`function* () {}`);else if(t===`%AsyncGeneratorFunction%`)n=y(`async function* () {}`);else if(t===`%AsyncGenerator%`){var r=e(`%AsyncGeneratorFunction%`);r&&(n=r.prototype)}else if(t===`%AsyncIteratorPrototype%`){var i=e(`%AsyncGenerator%`);i&&T&&(n=T(i.prototype))}return A[t]=n,n},j={__proto__:null,"%ArrayBufferPrototype%":[`ArrayBuffer`,`prototype`],"%ArrayPrototype%":[`Array`,`prototype`],"%ArrayProto_entries%":[`Array`,`prototype`,`entries`],"%ArrayProto_forEach%":[`Array`,`prototype`,`forEach`],"%ArrayProto_keys%":[`Array`,`prototype`,`keys`],"%ArrayProto_values%":[`Array`,`prototype`,`values`],"%AsyncFunctionPrototype%":[`AsyncFunction`,`prototype`],"%AsyncGenerator%":[`AsyncGeneratorFunction`,`prototype`],"%AsyncGeneratorPrototype%":[`AsyncGeneratorFunction`,`prototype`,`prototype`],"%BooleanPrototype%":[`Boolean`,`prototype`],"%DataViewPrototype%":[`DataView`,`prototype`],"%DatePrototype%":[`Date`,`prototype`],"%ErrorPrototype%":[`Error`,`prototype`],"%EvalErrorPrototype%":[`EvalError`,`prototype`],"%Float32ArrayPrototype%":[`Float32Array`,`prototype`],"%Float64ArrayPrototype%":[`Float64Array`,`prototype`],"%FunctionPrototype%":[`Function`,`prototype`],"%Generator%":[`GeneratorFunction`,`prototype`],"%GeneratorPrototype%":[`GeneratorFunction`,`prototype`,`prototype`],"%Int8ArrayPrototype%":[`Int8Array`,`prototype`],"%Int16ArrayPrototype%":[`Int16Array`,`prototype`],"%Int32ArrayPrototype%":[`Int32Array`,`prototype`],"%JSONParse%":[`JSON`,`parse`],"%JSONStringify%":[`JSON`,`stringify`],"%MapPrototype%":[`Map`,`prototype`],"%NumberPrototype%":[`Number`,`prototype`],"%ObjectPrototype%":[`Object`,`prototype`],"%ObjProto_toString%":[`Object`,`prototype`,`toString`],"%ObjProto_valueOf%":[`Object`,`prototype`,`valueOf`],"%PromisePrototype%":[`Promise`,`prototype`],"%PromiseProto_then%":[`Promise`,`prototype`,`then`],"%Promise_all%":[`Promise`,`all`],"%Promise_reject%":[`Promise`,`reject`],"%Promise_resolve%":[`Promise`,`resolve`],"%RangeErrorPrototype%":[`RangeError`,`prototype`],"%ReferenceErrorPrototype%":[`ReferenceError`,`prototype`],"%RegExpPrototype%":[`RegExp`,`prototype`],"%SetPrototype%":[`Set`,`prototype`],"%SharedArrayBufferPrototype%":[`SharedArrayBuffer`,`prototype`],"%StringPrototype%":[`String`,`prototype`],"%SymbolPrototype%":[`Symbol`,`prototype`],"%SyntaxErrorPrototype%":[`SyntaxError`,`prototype`],"%TypedArrayPrototype%":[`TypedArray`,`prototype`],"%TypeErrorPrototype%":[`TypeError`,`prototype`],"%Uint8ArrayPrototype%":[`Uint8Array`,`prototype`],"%Uint8ClampedArrayPrototype%":[`Uint8ClampedArray`,`prototype`],"%Uint16ArrayPrototype%":[`Uint16Array`,`prototype`],"%Uint32ArrayPrototype%":[`Uint32Array`,`prototype`],"%URIErrorPrototype%":[`URIError`,`prototype`],"%WeakMapPrototype%":[`WeakMap`,`prototype`],"%WeakSetPrototype%":[`WeakSet`,`prototype`]},M=dn(),N=yn(),ie=M.call(D,Array.prototype.concat),P=M.call(te,Array.prototype.splice),F=M.call(D,String.prototype.replace),I=M.call(D,String.prototype.slice),ae=M.call(D,RegExp.prototype.exec),L=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,oe=/\\(\\)?/g,se=function(e){var t=I(e,0,1),n=I(e,-1);if(t===`%`&&n!==`%`)throw new c("invalid intrinsic syntax, expected closing `%`");if(n===`%`&&t!==`%`)throw new c("invalid intrinsic syntax, expected opening `%`");var r=[];return F(e,L,function(e,t,n,i){r[r.length]=n?F(i,oe,`$1`):t||e}),r},R=function(e,t){var n=e,r;if(N(j,n)&&(r=j[n],n=`%`+r[0]+`%`),N(A,n)){var i=A[n];if(i===O&&(i=re(n)),i===void 0&&!t)throw new l(`intrinsic `+e+` exists, but is not available. Please file an issue!`);return{alias:r,name:n,value:i}}throw new c(`intrinsic `+e+` does not exist!`)};t.exports=function(e,t){if(typeof e!=`string`||e.length===0)throw new l(`intrinsic name must be a non-empty string`);if(arguments.length>1&&typeof t!=`boolean`)throw new l(`"allowMissing" argument must be a boolean`);if(ae(/^%?[^%]*%?$/,e)===null)throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=se(e),r=n.length>0?n[0]:``,i=R(`%`+r+`%`,t),a=i.name,o=i.value,s=!1,u=i.alias;u&&(r=u[0],P(n,ie([0,1],u)));for(var d=1,f=!0;d<n.length;d+=1){var p=n[d],m=I(p,0,1),h=I(p,-1);if((m===`"`||m===`'`||m==="`"||h===`"`||h===`'`||h==="`")&&m!==h)throw new c(`property names with quotes must have matching quotes`);if((p===`constructor`||!f)&&(s=!0),r+=`.`+p,a=`%`+r+`%`,N(A,a))o=A[a];else if(o!=null){if(!(p in o)){if(!t)throw new l(`base intrinsic for `+e+` exists, but the property is not available.`);return}if(b&&d+1>=n.length){var g=b(o,p);f=!!g,o=f&&`get`in g&&!(`originalValue`in g.get)?g.get:o[p]}else f=N(o,p),o=o[p];f&&!s&&(A[a]=o)}}return o}}}),xn=H({"node_modules/.pnpm/define-data-property@1.1.4/node_modules/define-data-property/index.js"(e,t){var n=an(),r=Gt(),i=Kt(),a=rn();t.exports=function(e,t,o){if(!e||typeof e!=`object`&&typeof e!=`function`)throw new i("`obj` must be an object or a function`");if(typeof t!=`string`&&typeof t!=`symbol`)throw new i("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!=`boolean`&&arguments[3]!==null)throw new i("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!=`boolean`&&arguments[4]!==null)throw new i("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!=`boolean`&&arguments[5]!==null)throw new i("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!=`boolean`)throw new i("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,c=arguments.length>4?arguments[4]:null,l=arguments.length>5?arguments[5]:null,u=arguments.length>6?arguments[6]:!1,d=!!a&&a(e,t);if(n)n(e,t,{configurable:l===null&&d?d.configurable:!l,enumerable:s===null&&d?d.enumerable:!s,value:o,writable:c===null&&d?d.writable:!c});else if(u||!s&&!c&&!l)e[t]=o;else throw new r(`This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.`)}}}),Sn=H({"node_modules/.pnpm/has-property-descriptors@1.0.2/node_modules/has-property-descriptors/index.js"(e,t){var n=an(),r=function(){return!!n};r.hasArrayLengthDefineBug=function(){if(!n)return null;try{return n([],`length`,{value:1}).length!==1}catch{return!0}},t.exports=r}}),Cn=H({"node_modules/.pnpm/set-function-length@1.2.2/node_modules/set-function-length/index.js"(e,t){var n=bn(),r=xn(),i=Sn()(),a=rn(),o=Kt(),s=n(`%Math.floor%`);t.exports=function(e,t){if(typeof e!=`function`)throw new o("`fn` is not a function");if(typeof t!=`number`||t<0||t>4294967295||s(t)!==t)throw new o("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],c=!0,l=!0;if(`length`in e&&a){var u=a(e,`length`);u&&!u.configurable&&(c=!1),u&&!u.writable&&(l=!1)}return(c||l||!n)&&(i?r(e,`length`,t,!0,!0):r(e,`length`,t)),e}}}),wn=H({"node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/applyBind.js"(e,t){var n=dn(),r=pn(),i=hn();t.exports=function(){return i(n,r,arguments)}}}),Tn=H({"node_modules/.pnpm/call-bind@1.0.8/node_modules/call-bind/index.js"(e,t){var n=Cn(),r=an(),i=gn(),a=wn();t.exports=function(e){var t=i(arguments),r=e.length-(arguments.length-1);return n(t,1+(r>0?r:0),!0)},r?r(t.exports,`apply`,{value:a}):t.exports.apply=a}}),En=H({"node_modules/.pnpm/call-bound@1.0.4/node_modules/call-bound/index.js"(e,t){var n=bn(),r=gn(),i=r([n(`%String.prototype.indexOf%`)]);t.exports=function(e,t){var a=n(e,!!t);return typeof a==`function`&&i(e,`.prototype.`)>-1?r([a]):a}}}),Dn=Te(H({"node_modules/.pnpm/json-stable-stringify@1.3.0/node_modules/json-stable-stringify/index.js"(e,t){var n=(typeof JSON<`u`?JSON:It()).stringify,r=Lt(),i=zt(),a=Tn(),o=En(),s=o(`Array.prototype.join`),c=o(`Array.prototype.indexOf`),l=o(`Array.prototype.splice`),u=o(`Array.prototype.sort`),d=function(e,t){for(var n=``,r=0;r<e;r+=1)n+=t;return n},f=function(e,t,n){return n};t.exports=function(e){var t=arguments.length>1?arguments[1]:void 0,o=t&&t.space||``;typeof o==`number`&&(o=d(o,` `));var p=!!t&&typeof t.cycles==`boolean`&&t.cycles,m=t&&t.replacer?a(t.replacer):f;if(t&&t.collapseEmpty!==void 0&&typeof t.collapseEmpty!=`boolean`)throw TypeError("`collapseEmpty` must be a boolean, if provided");var h=!!t&&t.collapseEmpty,g=typeof t==`function`?t:t&&t.cmp,_=g&&function(e){var t=g.length>2&&function(t){return e[t]};return function(n,r){return g({key:n,value:e[n]},{key:r,value:e[r]},t?{__proto__:null,get:t}:void 0)}},v=[];return(function e(t,a,f,g){var y=o?`
|
|
11
|
-
`+d(g,o):``,b=o?`: `:`:`;if(f&&f.toJSON&&typeof f.toJSON==`function`&&(f=f.toJSON()),f=m(t,a,f),f!==void 0){if(typeof f!=`object`||!f)return n(f);var x=function(e,t){return h&&e.length===0?t:(t===`[]`?`[`:`{`)+s(e,`,`)+y+(t===`[]`?`]`:`}`)};if(r(f)){for(var S=[],C=0;C<f.length;C++){var w=e(f,C,f[C],g+1)||n(null);S[S.length]=y+o+w}return x(S,`[]`)}if(c(v,f)!==-1){if(p)return n(`__cycle__`);throw TypeError(`Converting circular structure to JSON`)}else v[v.length]=f;for(var T=u(i(f),_&&_(f)),S=[],C=0;C<T.length;C++){var a=T[C],E=e(f,a,f[a],g+1);if(E){var ee=n(a)+b+E;S[S.length]=y+o+ee}}return l(v,c(v,f),1),x(S,`{}`)}})({"":e},``,e,0)}}})(),1),On=e=>localStorage.getItem(`kizen-flag-${e}`)===`true`,kn=(e=``)=>e.split(``).reduce((e,t)=>(e<<5)-e+t.charCodeAt(0)|0,0),An=e=>{try{return kn((0,Dn.default)(e))}catch(e){return On(`script-runner-logging`)&&console.warn(`Failed to stringify object for hashing:`,e),kn(String(Math.random()))}},jn=e=>{if(e===`boolean`)return!1},Mn=(e,t,n,r)=>{let i=Object.keys(e),a={};return i.forEach(r=>{t.includes(r)?a[r]={value:jn(n[r]?.type),type:n[r]?.type}:a[r]={value:e[r],type:n[r]?.type}}),L({fields:r??[]}).forEach(e=>{if(a[e.key]===void 0)if(t.includes(e.key))a[e.key]={value:jn(e.type),type:e.type};else if(e.type===`api_key`){let t=n[e.key];a[e.key]={type:e.type,hasValue:!!t?.hasValue,maskedValue:t?.maskedValue}}else a[e.key]={value:e.default,type:e.type}}),a},Nn=RegExp(`{{(${[`config`,`userConfig`,`plan`,`entitlement`].join(`|`)})\\.([^}]+)}}`,`g`),Pn=(e,t)=>{let n={};return Object.entries(e??{}).forEach(([e,t])=>{Object.entries(t).forEach(([t,r])=>{n[`plan__${e}__${t}`]={value:r}})}),Object.entries(t??{}).forEach(([e,t])=>{n[`entitlement__${e}`]={value:t}}),n},Fn=e=>e?e.replace(Nn,(e,t,n)=>`{{${t}__${n.replaceAll(`.`,`__`)}}}`):``,In=async(e,t)=>await ar(Fn(e),t),Ln=e=>{let t=e;return t=/^(http|https|kizen|kizenvoice):\/\//.test(e)?e:e.startsWith(`/`)?`${E().origin}${t}`:`${E().origin}/${t}`,t},Rn=(e,t)=>{let n=new URLSearchParams;return e&&e.forEach(e=>{e===`base_url`?n.append(e,E().origin):t&&n.append(e,t(e))}),n},zn=(e,t)=>{let n=t.toString();if(!n)return e;let r=e.indexOf(`#`),i=r===-1?e:e.slice(0,r),a=r===-1?``:e.slice(r);return`${i}${i.includes(`?`)?`&`:`?`}${n}${a}`},Bn=(e,t,n)=>zn(Ln(e??``),Rn(t,n)),Vn=(e,t,n)=>zn(e??``,Rn(t,n)),Hn=(e,t,n)=>{if(!e)return{html:``,error:null,removed:[]};try{let r=Nt();return r.addHook(`uponSanitizeElement`,(e,r)=>{if(r.tagName===`iframe`){let r=e,{url:i,isUsingProxy:a}=B(r.getAttribute(`src`)??``,n,r.getAttribute(`allow`)??``);a&&r.setAttribute(`allow`,ve()),r.setAttribute(`src`,i),r.setAttribute(`name`,t??``)}}),{html:r.sanitize(e,{ADD_TAGS:[`iframe`],ADD_ATTR:[`allow`,`allowfullscreen`,`frameborder`,`scrolling`,`src`,`sandbox`,`name`,`loading`,`width`,`height`,`title`]}),error:null,removed:r.removed}}catch(e){return{html:``,error:e,removed:[]}}},Un=`kizen-app-context`,Wn=`session_data_key`,Gn=()=>`${Un}-${ee()}`,Kn=e=>{try{let t=new URL(e,window.location.origin).searchParams.get(Wn);return t?.startsWith(`${Un}-`)?t:null}catch{return null}},qn=e=>{let t=Gn();return sessionStorage.setItem(t,JSON.stringify(e)),t},Jn=(e,t)=>{let n=new URL(e,window.location.origin);return n.searchParams.set(Wn,t),`${n.pathname}${n.search}${n.hash}`},Yn=e=>{let t=Kn(e);if(t)try{let e=sessionStorage.getItem(t);return e?JSON.parse(e):void 0}catch{return}},Xn=e=>{let t=Kn(e);t&&sessionStorage.removeItem(t)},Zn=e=>{let t=Yn(e);return Xn(e),t},Qn=e=>e.startsWith(`/`),$n=e=>{try{return new URL(e,window.location.origin).origin===window.location.origin}catch{return!1}},er=3e4,tr=100,nr=class{worker;scriptUIRef;onStateChange;done;onError;waitForFrame=!1;plugin;executionPlugin;frameId;onShowToast;onClearToasts;sessionData={};setSessionData;pluginComponentId;onShowModal;onCloseModal;onShowCreateRecordModal;onShowCreateRelatedRecordModal;onReleaseBlockingScript;pluginApiName;onNetworkError;onNetworkRequest;invalidateCache;getPendingCacheCount;createFileId;performFileUpload;pushHistory;appPath;onConsoleLog;onRunEventScript;onCompleteSetup;isDebug;constructor(e){this.scriptUIRef=e.scriptUIRef,this.onStateChange=e.onStateChange,this.done=e.done,this.onError=e.onError,this.onReleaseBlockingScript=e.onReleaseBlockingScript,this.worker=e.worker,this.worker.onmessage=this.handleMessage,this.plugin=e.plugin,this.executionPlugin=e.executionPlugin,this.onShowToast=e.onShowToast,this.onClearToasts=e.onClearToasts,this.pluginComponentId=e.pluginComponentId,this.onShowModal=e.onShowModal,this.onCloseModal=e.onCloseModal,this.onShowCreateRecordModal=e.onShowCreateRecordModal,this.onShowCreateRelatedRecordModal=e.onShowCreateRelatedRecordModal,this.onNetworkError=e.onNetworkError,this.onNetworkRequest=e.onNetworkRequest,this.invalidateCache=e.invalidateCache,this.getPendingCacheCount=e.getPendingCacheCount,this.createFileId=e.createFileId,this.performFileUpload=e.performFileUpload,this.pushHistory=e.pushHistory,this.appPath=e.appPath,this.onConsoleLog=e.onConsoleLog,this.onRunEventScript=e.onRunEventScript,this.onCompleteSetup=e.onCompleteSetup,this.isDebug=e.isDebug??!1,this.plugin&&(this.frameId=`${g}-${this.plugin.plugin_api_name}-${this.plugin.api_name}`),this.pluginApiName=this.executionPlugin?.plugin_api_name??this.plugin?.plugin_api_name??``,this.pluginApiName?(this.sessionData=e.sessionData[this.pluginApiName],this.setSessionData=t=>{e.setSessionData?.(this.pluginApiName,t)}):this.setSessionData=()=>{this.onError?.({message:`Script must be associated with a plugin to use session data`})}}handleMessage=async e=>{let t=JSON.parse(e.data),{action:n}=t;switch(n){case d.QUERY_REQUEST:{let e=t;await this.handleQueryRequest(e.id,e.method,e.url,e.payload,e.options);return}case d.UI_OUTPUT:{let e=t;this.handleUIOutput(e.markup,e.options);return}case d.COMPLETE_SETUP_REQUEST:{let e=t;await this.handleCompleteSetupRequest(e.id,e.payload,e.options);return}case d.IFRAME_OUTPUT:{let e=t;this.handleIframeOutput(e.url,e.allow,e.sandbox,e.preserve,e.name,e.isUsingProxy);return}case d.POSTFORMDATA_REQUEST:{let e=t;this.handleFormPostRequest(e.id,e.url,e.payload,e.createNewTab);return}case d.UPLOADFILE_REQUEST:{let e=t;await this.handleUploadFileRequest(e.id,e.payload);return}case d.SETSTATE:{let e=t;this.onStateChange?.(e.state);return}case d.DONE:{let e=t;this.handleDone(e.preserve,e.result);return}case f.ERROR:{let e=t;this.onError?.({message:e.error});return}case d.OPEN_WINDOW:{let e=t;this.handleOpenWindow(e.url,e.target,e.features,e.context);return}case d.COMMUNICATE:{let e=t;this.handleCommunication(e.type,e.recipient,e.args,e.params);return}case d.HIDE:{let{config:e}=t,n=!1;e.hideTrigger&&(n=!0),this.onStateChange?.({hidden:!0,triggerHidden:n});return}case d.SHOW:{let{config:e}=t,n=!1;e.showTrigger===!1&&(n=!0),this.onStateChange?.({hidden:!1,triggerHidden:n});return}case d.EXPAND:this.onStateChange?.({minimized:!1});return;case d.COLLAPSE:this.onStateChange?.({minimized:!0});return;case d.HIDE_HEADER:this.onStateChange?.({hideHeader:!0});return;case d.SHOW_HEADER:this.onStateChange?.({hideHeader:!1});return;case d.COPY_TO_CLIPBOARD:{let e=t;await this.copyToClipboard(e.text);return}case d.OPEN_CREATE_RECORD_MODAL_REQUEST:{let e=t;this.handleCreateRecordRequest(e.id,e.entityId);return}case d.OPEN_CREATE_RELATED_RECORD_MODAL_REQUEST:{let e=t;this.handleCreateRelatedRecordRequest(e.id,e.objectId,e.relatedEntityId);return}case d.SHOW_TOAST:{let e=t;this.showToast(e.message,e.toastOptions);return}case d.CLEAR_TOASTS:this.clearToasts();return;case d.REFRESH_TIMELINE:{let e=t;this.handleRefreshTimeline(e.entityId);return}case d.REFRESH_ENTITY:{let e=t;await this.handleRefreshEntity(e.entityId,e.id);return}case d.UPDATE_SESSION_DATA:{let e=t;this.handleSetSessionData(e.update);return}case d.INSTALL_THIRD_PARTY_SCRIPT_REQUEST:{let e=t;this.handleInstallThirdPartyScriptRequest(e.id,e.url,e.args);return}case d.PROMPT_REQUEST:{let e=t;this.handlePromptRequest(e.id,e.config,!1);return}case d.DYNAMIC_PROMPT_REQUEST:{let e=t;this.handlePromptRequest(e.id,e.config,!0);return}case d.SHOW_VIEW_IN_MODAL_REQUEST:{let e=t;this.handleShowViewInModalRequest(e.id,e.viewId,e.args,e.options);return}case d.CLOSE_MODAL_REQUEST:{let e=t;this.onCloseModal?.(e.values,e.canceled);return}case d.RELEASE_BLOCKING_SCRIPT:this.handleReleaseBlockingScript();return;case d.AUTHORIZE:{let e=t;this.handleAuthorize(e.serviceName,e.config);return}case d.CONSOLE_LOG:{let e=t,n=[];try{n=e.args.map(k)}catch{n=[`[unparseable plugin log]`]}try{console[e.level](...n)}catch{}try{this.onConsoleLog?.(e.level,n)}catch{}return}case d.RUN_EVENT_SCRIPT:{let e=t;this.onRunEventScript?.(e.scriptName,e.args),!this.onRunEventScript&&this.isDebug&&console.warn(`No handler for RUN_EVENT_SCRIPT: ${e.scriptName}`);return}default:return}};handleCommunication=(e,t,n,r)=>{if(e===p.SEND_MESSAGE_TO_FRAME){if(this.frameId){let e=document.getElementById(this.frameId);e&&e.contentWindow?.postMessage({...n?.payload??{},__kizen:{recipient:t,frameId:this.frameId}},n?.path??`*`)}}else if(e===p.CALL_THIRD_PARTY_SCRIPT)this.handleCallThirdPartyScript(t.type,r);else{let r=new CustomEvent(`integration:${e}`,{detail:{recipient:{...t,plugin:this.pluginApiName},args:n}});window.dispatchEvent(r)}};handleDone=(e,t)=>{this.waitForFrame||this.done(e,t)};postMessage=(e,t)=>{this.worker.postMessage(JSON.stringify({action:e,...t}))};handleSetSessionData=e=>{this.setSessionData(e)};handleQueryRequest=async(e,t,n,r,i)=>{try{let a=await this.onNetworkRequest?.(t,n,r,i);this.postMessage(f.QUERY_RESPONSE,{data:a,id:e})}catch(t){this.onNetworkError?.(t);let n=t instanceof A?{__kizenError:!0,proxyStatus:t.proxyStatus,upstreamStatus:t.upstreamStatus,upstreamResponse:t.upstreamResponse,message:t.message}:(()=>{if(t instanceof Error)return{message:t.message,name:t.name};try{let e=JSON.parse(JSON.stringify(t));if(typeof e==`object`&&e&&!Array.isArray(e))return e}catch{}return{message:String(t)}})();this.postMessage(f.QUERY_RESPONSE,{error:n,id:e})}};handleUIOutput=(e,t)=>{if(this.scriptUIRef?.current){let n=Hn(e,this.pluginApiName,t).html;this.scriptUIRef.current.innerHTML=n}};handleCompleteSetupRequest=async(e,t,n)=>{if(!this.onCompleteSetup){this.postMessage(f.COMPLETE_SETUP_RESPONSE,{id:e,success:!1,error:`Completing setup is not supported by this host`});return}try{await this.onCompleteSetup(t,n),this.postMessage(f.COMPLETE_SETUP_RESPONSE,{id:e,success:!0})}catch(t){this.postMessage(f.COMPLETE_SETUP_RESPONSE,{id:e,success:!1,error:t instanceof Error?t.message:`Setup configuration could not be saved`})}};onLoad=e=>{e.iframe&&(this.waitForFrame=!1,this.handleDone(e.preserve))};handleIframeOutput=(e,t=[],n=[],r=!1,i=``,a=!0)=>{if(this.scriptUIRef?.current){let o=ve(),s=_e(n);this.waitForFrame=!0;let c=document.createElement(`iframe`);a?c.allow=o:c.allow=ge(t).join(`; `),c.name=i,c.src=e,s.forEach(e=>{c.sandbox.add(e)}),c.style.border=`none`,c.style.width=`100%`,c.style.height=`100%`,c.onload=this.onLoad.bind(this,{iframe:c,preserve:r}),this.frameId&&(c.id=this.frameId),this.scriptUIRef.current.replaceChildren(c)}};handleCreateRecordRequest=(e,t)=>{this.onShowCreateRecordModal?.(t,t=>{this.postMessage(f.CREATE_RECORD_RESPONSE,{id:e,data:t})})};handleCreateRelatedRecordRequest=(e,t,n)=>{this.onShowCreateRelatedRecordModal?.(t,n,t=>{this.postMessage(f.CREATE_RELATED_RECORD_RESPONSE,{id:e,data:t})})};showToast=(e,t)=>{this.onShowToast?.({message:e,variant:t?.variant??`success`,autohide:t?.autohide??!0})};clearToasts=()=>{this.onClearToasts?.()};copyToClipboard=async e=>{try{await navigator.clipboard.writeText(e)}catch(e){this.onError?.({message:e.message})}};handleRefreshTimeline=e=>{this.invalidateCache?.(`timeline`,e)};waitForIdleState=e=>new Promise(t=>{let n=0,r=setInterval(()=>{(this.getPendingCacheCount?.(e)??0)===0?(clearInterval(r),t(!0)):(n+=1,n>Math.floor(er/tr)&&(clearInterval(r),t(!1)))},tr)});handleRefreshEntity=async(e,t)=>{this.invalidateCache?.(`entity`,e);let n=await this.waitForIdleState(e);this.postMessage(f.REFRESH_ENTITY_RESPONSE,{id:t,data:{success:n}})};handleFormPostRequest=(e,t,n,r)=>{let i=document.createElement(`form`);i.method=`POST`,i.action=t,r&&(i.target=`_blank`);for(let e in n){let t=document.createElement(`input`);t.type=`hidden`,t.name=e,t.value=n[e],i.appendChild(t)}document.body.appendChild(i),i.submit(),r&&document.body.removeChild(i),this.postMessage(f.POSTFORMDATA_RESPONSE,{success:!0,id:e})};handleUploadFileRequest=async(e,t)=>{if(!this.performFileUpload){this.postMessage(f.UPLOADFILE_RESPONSE,{error:`File upload not supported`,id:e});return}let{file:n,isPublic:r=!1,fileName:i}=t,a=await(await fetch(n)).blob(),o=new File([a],i??`upload-${new Date().toISOString()}`,{type:a.type});o.$id=this.createFileId?.()??ee();let s=await this.performFileUpload({file:o,id:o.$id,publicFile:r,source:`field_value`,handleProgress:e=>{this.postMessage(f.UPLOADFILE_PROGRESS,{fileId:e.id,progress:e.progress})},businessId:void 0});this.postMessage(f.UPLOADFILE_RESPONSE,{data:s,id:e})};waitForReadyState=(e,t,n=0)=>{e||t?.(!0),e?.()?t?.(!0):n<20?setTimeout(()=>{this.waitForReadyState(e,t,n+1)},n*50):t?.(!1)};handleCallThirdPartyScript=(e,t=[])=>{if(e&&C[e]){let n=C[e],r=window[n];r?.(...t)}};handleReleaseBlockingScript=()=>this.onReleaseBlockingScript?.(this.executionPlugin);handlePromptRequest=(e,t,n=!1)=>{this.onShowModal?this.onShowModal({...t,pluginApiName:this.pluginApiName,dynamic:n},(t={})=>{this.postMessage(f.PROMPT_RESPONSE,{id:e,data:t})}):this.postMessage(f.PROMPT_RESPONSE,{id:e,data:{canceled:!0}})};handleShowViewInModalRequest=(e,t,n,r)=>{this.onShowModal?this.onShowModal({viewId:t,...n!==void 0&&{args:n},pluginApiName:this.pluginApiName,...r?.size!==void 0&&{size:r.size},...r?.frameless?{frameless:!0}:{...r?.title!==void 0&&{title:r.title},...r?.confirmButton!==void 0&&{confirmButton:r.confirmButton},...r?.cancelButton!==void 0&&{cancelButton:r.cancelButton}}},(t={})=>{this.postMessage(f.PROMPT_RESPONSE,{id:e,data:t})}):this.postMessage(f.PROMPT_RESPONSE,{id:e,data:{canceled:!0}})};handleInstallThirdPartyScriptRequest=(e,t,n={})=>{let r=S(t);if(!r){this.postMessage(f.INSTALL_THIRD_PARTY_SCRIPT_RESPONSE,{data:{success:!1,url:t},id:e});return}let i=w[r];i(n);let a=document.createElement(`script`);a.onload=()=>{this.waitForReadyState(T[r],n=>{this.postMessage(f.INSTALL_THIRD_PARTY_SCRIPT_RESPONSE,{data:{success:!0,url:t,matched:n},id:e})})},a.onerror=()=>{this.postMessage(f.INSTALL_THIRD_PARTY_SCRIPT_RESPONSE,{data:{success:!1,url:t},id:e})},a.src=t,a.setAttribute(`data-script-url`,t),document.querySelectorAll(`[data-script-url="`+t+`"]`).length>0?this.waitForReadyState(T[r],n=>{this.postMessage(f.INSTALL_THIRD_PARTY_SCRIPT_RESPONSE,{data:{success:!0,url:t,reused:!0,matched:n},id:e})}):document.documentElement.firstChild?.appendChild(a)};applyNavigationContext=(e,t)=>{let n;try{n=qn(t)}catch{return this.onError?.({message:`Failed to store context in sessionStorage.`}),e}try{return Jn(e,n)}catch{try{sessionStorage.removeItem(n)}catch{}return this.onError?.({message:`Failed to append the context key to the navigation URL.`}),e}};handleOpenWindow=(e,t,n,r)=>{let{pushHistory:i}=this;if(Qn(e)&&t!==`_blank`){let a=r?this.applyNavigationContext(e,r):e;i?i(a):window.open(a,t,n);return}if(Qn(e)&&t===`_blank`&&r&&$n(e)){let i;try{i=qn(r)}catch{this.onError?.({message:`Failed to store context in sessionStorage.`}),window.open(e,t,n);return}window.open(Jn(e,i),`_blank`),sessionStorage.removeItem(i);return}window.open(e,t,n)};handleAuthorize=(e,t={})=>{let n=new URLSearchParams;if(t.successRedirectPath&&n.append(`success_redirect_path`,t.successRedirectPath),t.errorRedirectPath&&n.append(`error_redirect_path`,t.errorRedirectPath),!this.appPath){this.onError?.({message:`App path is not defined.`});return}if(!this.pluginApiName){this.onError?.({message:`Plugin API name is not defined.`});return}let r=n.toString();this.handleOpenWindow(`${this.appPath}/external-integrations/business-plugin-apps/${this.pluginApiName}/services/${encodeURIComponent(e)}/authorize${r?`?${r}`:``}`,`_blank`,``)};run=(e,t,n)=>{let r=E();this.postMessage(d.RUN,{script:e,setup:t,args:n,sessionData:this.sessionData,pluginComponentId:this.pluginComponentId,pluginApiName:this.pluginApiName,location:r})}},rr=async({scriptBody:e,user:t,teamMember:n,business:r,onError:i,onReleaseBlockingScript:a,setLoadingState:o,clientObject:s,scriptUIRef:c,onStateChange:l,workerName:u,context:d,args:f=``,plugin:p,onShowToast:m,onClearToasts:h,terminators:g,executionPlugin:_,sessionData:v,setSessionData:y,onShowModal:b,onCompleteSetup:x,onCloseModal:S,onShowCreateRecordModal:C,onShowCreateRelatedRecordModal:w,onNetworkError:T,onNetworkRequest:E,appPath:ee,pushHistory:te,createFileId:D,performFileUpload:O,getPendingCacheCount:k,invalidateCache:A,onConsoleLog:ne,onRunEventScript:re})=>{let j=On(`script-runner-logging`),M;return M=u===`recordDetail`?new Worker(new URL(`/assets/recordDetail.worker-DrTKYLJc.js`,``+import.meta.url),{type:`module`}):u===`genericPlugin`?new Worker(new URL(`/assets/generic.worker-DKCeuXG7.js`,``+import.meta.url),{type:`module`}):u===`floatingFramePlugin`?new Worker(new URL(`/assets/floatingFrame.worker-Cy3ysIc7.js`,``+import.meta.url),{type:`module`}):new Worker(new URL(`/assets/calendarSource.worker-DjLHW14n.js`,``+import.meta.url),{type:`module`}),new Promise(u=>{let N=kn(e),ie=kn(f),P=`${p?.plugin_api_name??``}-${p?.api_name??``}-${p?.worker_key??``}-${String(N)}-${String(ie)}`,F=`${p?.plugin_api_name??``}-${p?.api_name??``}`;_?.field_type?(P=`${_.plugin_api_name??``}-${_.worker_key??``}-${_.field_type}-${String(N)}-${String(ie)}`,F=`${_.plugin_api_name??``}-${_.field_type??_.script_id}`):_&&(P=`${_.plugin_api_name??``}-${_.worker_key??``}-${_.api_name}-${String(N)}-${String(ie)}`,F=`${_.plugin_api_name??``}-${_.api_name}`),g.current[P]&&(g.current[P]?.forEach(e=>{e()}),g.current[P]=[]),g.current[P]??=[],g.current[P]?.push(()=>{M.terminate()});let I=new nr({worker:M,done:(e,t)=>{o(!1),e||(g.current[P]?.forEach(e=>{e()}),g.current[P]=[]),u(t)},onError:i,onReleaseBlockingScript:a,scriptUIRef:c,onStateChange:l,plugin:p,executionPlugin:_,onShowToast:m,onClearToasts:h,sessionData:v,setSessionData:y,pluginComponentId:F,onShowModal:b,onCompleteSetup:x,onCloseModal:S,onShowCreateRecordModal:C,onShowCreateRelatedRecordModal:w,onNetworkError:T,pushHistory:te,onNetworkRequest:E,appPath:ee,createFileId:D,performFileUpload:O,getPendingCacheCount:k,invalidateCache:A,onConsoleLog:ne,onRunEventScript:re,isDebug:j});o(!0),I.run(e,{...d,user:t,teamMember:n,business:r,clientObject:s,appPath:ee,isDebug:j},f)})},ir=(e,t)=>{let n=new Worker(new URL(`/assets/expression.worker-Cin-WNVB.js`,``+import.meta.url),{type:`module`});return new Promise(r=>{n.onmessage=e=>{let t=JSON.parse(e.data);n.terminate(),r(t.result)};let i=On(`script-runner-logging`);n.postMessage(JSON.stringify({expression:e,args:t,isDebug:i}))})},ar=async(e,t)=>await ir(e,t),or=async(e,t)=>await ir(e,t),sr=async(e,t)=>await ir(e,t),cr=async(e,t)=>await ir(e,t),lr=e=>{let t={...e,data:e.data.body??e.data,status:e.data.status_code??e.status};return{response:t,upstreamStatus:t.status,upstreamResponse:e.data.body}},ur=(e,t,n)=>new A(e,t,n),dr=(e,t)=>new A(e??500,void 0,void 0,t??`An unknown error occurred in the proxy`),fr=e=>{let{response:t,upstreamStatus:n,upstreamResponse:r}=lr(e);if(n>=400)throw ur(200,n,r);return t},pr=(e,t,n)=>{let r=L(t).filter(e=>e.type===`api_key`);if(r.length===0)return{sanitized:e,secretsToCreate:[]};let i=n?new Set(n):void 0,a={...e},o=[];for(let t of r){let n=e[t.key];if(n){if(i&&!i.has(t.key)){a[t.key]={type:`api_key`,hasValue:!!n.hasValue};continue}if(n.value){if(!t.secret)throw Error(`api_key field "${t.key}" does not declare a secret`);o.push({fieldKey:t.key,secretName:t.secret,value:n.value}),a[t.key]={type:`api_key`,hasValue:!0}}else a[t.key]={type:`api_key`,hasValue:!!n.hasValue}}}return{sanitized:a,secretsToCreate:o}},mr=async(e,t,n)=>{let r={},i={},a=Object.keys(e),o=kn(JSON.stringify(t));for(let t of a)if(ie(t)){let{actionApiName:n,objectId:i}=F(t);if(n&&i){let a=j(n),o=r[a]??{};r[a]={...o,menuFlags:{...o.menuFlags??{},[i]:!!e[t]?.value}}}}else P(t)?r[t]={...r[t],...e[t]}:e[t]&&(i[t]=e[t]);let{sanitized:s,secretsToCreate:c}=pr(i,t,n?.includedKeys);if(n?.saveSecret)for(let e of c)await n.saveSecret({pluginApiName:n.pluginApiName??``,secretName:e.secretName,value:e.value});return{partialNewConfig:{__kizen_setup_assistant_values:s,__kizen_setup_assistant_hash:o,__kizen_clean_config:oe(t,s)},actionsToLink:r,secretsToCreate:c}};function hr(){let{apiKey:e,userId:t,businessId:a,environment:o}=n(),s=i[o];return(0,r.useCallback)((n,r={})=>fetch(`/api/proxy${n}`,{...r,headers:{"x-proxy-target":s,"X-API-KEY":e,"X-USER-ID":t,"X-BUSINESS-ID":a,...r.headers}}),[s,e,t,a])}var gr=e=>async(t,n,r,i)=>{if(n.startsWith(`/external-integrations/proxy`))try{let a=await e.request(t,n,r,i);return fr({data:a,status:a.status_code??200})}catch(e){throw e instanceof A?e:c(e)?dr(e.response?.status,e.response?.data?.error):e}else return{data:await e.request(t,n,r,i)}};export{g as A,j as C,pe as D,I as E,a as F,i as I,h as M,m as N,te as O,u as P,oe as S,L as T,cr as _,Zn as a,or as b,Vn as c,An as d,On as f,ar as g,Fn as h,Xn as i,v as j,p as k,Hn as l,Yn as m,hr as n,Pn as o,Mn as p,mr as r,In as s,gr as t,Bn as u,sr as v,N as w,B as x,rr as y};
|