import{s as Re,e as C,c as L,b as T,f as y,m as S,i as z,q as J,k as je,Q as zt,t as b,d as x,h as w,j as Z,n as ce,a as U,g as G,R as pt,S as _t,T as gt,l as Oe,L as mt,U as xe,V as Dt,p as $t,C as Pt,r as qt,z as Bt,W as Ft,y as fe,I as Je}from"./scheduler.CXEVs2ap.js";import{S as Ue,i as Ge,g as re,t as M,c as oe,a as F,e as ge,f as me,m as ke,h as ve}from"./index.CTdcniaS.js";import{e as Ie,u as Rt,o as jt}from"./each.CypvCfon.js";import{K as He,a as Ke,b as Ut}from"./keymap-codes.DVdCLxHW.js";import{L as Me}from"./i18n-svelte.D0STxjoQ.js";import{A as Gt,a as Ve}from"./Action.tNSJ0eLt.js";var D;function Ce(e){return typeof e<"u"?e:!0}function Ye(e){const t=Array(e);for(let n=0;n=this.B&&(a||!h[u])){var l=Ee(p,i,k),o="";switch(this.G){case"full":if(2l;r--)if(r-l>=this.B){var c=Ee(p,i,k,s,l);o=u.substring(l,r),pe(this,h,o,c,e,n)}break}case"reverse":if(1=this.B&&pe(this,h,o,Ee(p,i,k,s,r),e,n);o=""}case"forward":if(1=this.B&&pe(this,h,o,l,e,n);break}default:if(this.C&&(l=Math.min(l/this.C(t,u,k)|0,p-1)),pe(this,h,u,l,e,n),a&&1=this.B&&!s[u]){s[u]=1;const d=this.l&&u>l;pe(this,f,d?l:u,Ee(o+(i/2>o?0:1),i,k,r-1,c-1),e,n,d?u:l)}}}}}this.m||(this.register[e]=1)}}return this};function Ee(e,t,n,i,s){return n&&1=this.B&&!n[p])if(this.s||l||this.map[p])c[a++]=p,n[p]=1;else return i;e=c,s=e.length}if(!s)return i;t||(t=100),r=this.depth&&1=i))));p++);if(h){if(l)return Lt(c,i,0);t[t.length]=c;return}}return!n&&c}function Lt(e,t,n){return e=e.length===1?e[0]:[].concat.apply([],e),n||e.length>t?e.slice(n,n+t):e}function Ze(e,t,n,i){return n?(i=i&&t>n,e=(e=e[i?t:n])&&e[i?n:t]):e=e[t],e}D.contain=function(e){return!!this.register[e]};D.update=function(e,t){return this.remove(e).add(e,t)};D.remove=function(e,t){const n=this.register[e];if(n){if(this.m)for(let i=0,s;i"u"&&(o=new Promise(f=>{l=f}));let r,c;switch(s||(s=0)){case 0:if(r="reg",this.m){c=O();for(let f in this.register)c[f]=1}else c=this.register;break;case 1:r="cfg",c={doc:0,opt:this.s?1:0};break;case 2:r="map",c=this.map;break;case 3:r="ctx",c=this.h;break;default:typeof n>"u"&&l&&l();return}return Ct(e,t||this,n,r,i,s,c,l),o};D.import=function(e,t){if(t)switch(W(t)&&(t=JSON.parse(t)),e){case"cfg":this.s=!!t.opt;break;case"reg":this.m=!1,this.register=t;break;case"map":this.map=t;break;case"ctx":this.h=t}};wt(te.prototype);function Kt(e){e=e.data;var t=self._index;const n=e.args;var i=e.task;switch(i){case"init":i=e.options||{},e=e.factory,t=i.encode,i.cache=!1,t&&t.indexOf("function")===0&&(i.encode=Function("return "+t)()),e?(Function("return "+e)()(self),self._index=new self.FlexSearch.Index(i),delete self.FlexSearch):self._index=new te(i);break;default:e=e.id,t=t[i].apply(t,n),postMessage(i==="search"?{id:e,msg:t}:{id:e})}}let et=0;function he(e){if(!(this instanceof he))return new he(e);var t;e?We(t=e.encode)&&(e.encode=t.toString()):e={},(t=(self||window)._factory)&&(t=t.toString());const n=typeof window>"u"&&self.exports,i=this;this.o=Vt(t,n,e.worker),this.h=O(),this.o&&(n?this.o.on("message",function(s){i.h[s.id](s.msg),delete i.h[s.id]}):this.o.onmessage=function(s){s=s.data,i.h[s.id](s.msg),delete i.h[s.id]},this.o.postMessage({task:"init",factory:t,options:e}))}ye("add");ye("append");ye("search");ye("update");ye("remove");function ye(e){he.prototype[e]=he.prototype[e+"Async"]=function(){const t=this,n=[].slice.call(arguments);var i=n[n.length-1];let s;return We(i)&&(s=i,n.splice(n.length-1,1)),i=new Promise(function(l){setTimeout(function(){t.h[++et]=l,t.o.postMessage({task:e,id:et,args:n})})}),s?(i.then(s),this):i}}function Vt(e,t,n){let i;try{i=t?new(require("worker_threads")).Worker(__dirname+"/node/node.js"):e?new Worker(URL.createObjectURL(new Blob(["onmessage="+Kt.toString()],{type:"text/javascript"}))):new Worker(W(n)?n:"worker/worker.js",{type:"module"})}catch{}return i}function _e(e){if(!(this instanceof _e))return new _e(e);var t=e.document||e.doc||e,n;this.K=[],this.h=[],this.A=[],this.register=O(),this.key=(n=t.key||t.id)&&Se(n,this.A)||"id",this.m=Ce(e.fastupdate),this.C=(n=t.store)&&n!==!0&&[],this.store=n&&O(),this.I=(n=t.tag)&&Se(n,this.A),this.l=n&&O(),this.cache=(n=e.cache)&&new Te(n),e.cache=!1,this.o=e.worker,this.async=!1,n=O();let i=t.index||t.field||t;W(i)&&(i=[i]);for(let s=0,l,o;st||n)&&(s=s.slice(n,n+t)),i&&(s=It.call(this,s)),{tag:e,result:s}}function It(e){const t=Array(e.length);for(let n=0,i;n"u"&&(o=new Promise(r=>{l=r})),s||(s=0),i||(i=0),i{c[p]=null}),oe(),i=c[n],i?i.p(h,a):(i=c[n]=r[n](h),i.c()),F(i,1),i.m(t,null))},i(h){s||(F(i),s=!0)},o(h){M(i),s=!1},d(h){h&&y(t),c[n].d(),l=!1,o()}}}function dn(e,t,n){let i,s;je(e,Me,r=>n(1,s=r));let{id:l}=t;function o(r){zt.call(this,e,r)}return e.$$set=r=>{"id"in r&&n(2,l=r.id)},e.$$.update=()=>{e.$$.dirty&4&&n(0,i=typeof l=="number"?He.get(l)??l:l)},[i,s,l,o]}class ze extends Ue{constructor(t){super(),Ge(this,t,dn,an,Re,{id:2})}}function lt(e,t,n){const i=e.slice();return i[29]=t[n],i}function Pe(e){const t=e.slice(),n=t[2].length===0?Array.from(He,([i])=>i):t[2];return t[28]=n,t}function rt(e,t,n){const i=e.slice();return i[32]=t[n],i}function ot(e){let t,n=e[32].name+"",i,s,l,o,r;return l=gt(e[18][0]),{c(){t=C("label"),i=b(n),s=C("input"),this.h()},l(c){t=L(c,"LABEL",{class:!0});var f=T(t);i=x(f,n),s=L(f,"INPUT",{name:!0,type:!0,class:!0}),f.forEach(y),this.h()},h(){S(s,"name","category"),S(s,"type","radio"),s.__value=new Set(Object.keys(e[32].actions).map(Number)),mt(s,s.__value),S(s,"class","svelte-1x90noz"),S(t,"class","svelte-1x90noz"),l.p(s)},m(c,f){z(c,t,f),w(t,i),w(t,s),s.checked=s.__value===e[7],o||(r=J(s,"change",e[19]),o=!0)},p(c,f){f[0]&128&&(s.checked=s.__value===c[7])},d(c){c&&y(t),l.r(),o=!1,r()}}}function ct(e){let t,n,i=e[8].actionSearch.CURRENT_ACTION()+"",s,l,o,r,c,f;o=new ze({props:{id:e[0]}});let h=e[1]&&ft(e);return{c(){t=C("aside"),n=C("h3"),s=b(i),l=U(),ge(o.$$.fragment),r=U(),h&&h.c(),c=fe(),this.h()},l(a){t=L(a,"ASIDE",{class:!0});var p=T(t);n=L(p,"H3",{class:!0});var k=T(n);s=x(k,i),k.forEach(y),l=G(p),me(o.$$.fragment,p),p.forEach(y),r=G(a),h&&h.l(a),c=fe(),this.h()},h(){S(n,"class","svelte-1x90noz"),S(t,"class","svelte-1x90noz")},m(a,p){z(a,t,p),w(t,n),w(n,s),w(t,l),ke(o,t,null),z(a,r,p),h&&h.m(a,p),z(a,c,p),f=!0},p(a,p){(!f||p[0]&256)&&i!==(i=a[8].actionSearch.CURRENT_ACTION()+"")&&Z(s,i);const k={};p[0]&1&&(k.id=a[0]),o.$set(k),a[1]?h?(h.p(a,p),p[0]&2&&F(h,1)):(h=ft(a),h.c(),F(h,1),h.m(c.parentNode,c)):h&&(re(),M(h,1,1,()=>{h=null}),oe())},i(a){f||(F(o.$$.fragment,a),F(h),f=!0)},o(a){M(o.$$.fragment,a),M(h),f=!1},d(a){a&&(y(t),y(r),y(c)),ve(o),h&&h.d(a)}}}function ft(e){let t,n,i=e[8].actionSearch.NEXT_ACTION()+"",s,l,o,r;return o=new ze({props:{id:e[1]}}),{c(){t=C("aside"),n=C("h3"),s=b(i),l=U(),ge(o.$$.fragment),this.h()},l(c){t=L(c,"ASIDE",{class:!0});var f=T(t);n=L(f,"H3",{class:!0});var h=T(n);s=x(h,i),h.forEach(y),l=G(f),me(o.$$.fragment,f),f.forEach(y),this.h()},h(){S(n,"class","svelte-1x90noz"),S(t,"class","svelte-1x90noz")},m(c,f){z(c,t,f),w(t,n),w(n,s),w(t,l),ke(o,t,null),r=!0},p(c,f){(!r||f[0]&256)&&i!==(i=c[8].actionSearch.NEXT_ACTION()+"")&&Z(s,i);const h={};f[0]&2&&(h.id=c[1]),o.$set(h)},i(c){r||(F(o.$$.fragment,c),r=!0)},o(c){M(o.$$.fragment,c),r=!1},d(c){c&&y(t),ve(o)}}}function ht(e){let t,n,i="Exact match",s,l,o;return l=new ze({props:{id:e[3]}}),l.$on("click",e[20]),{c(){t=C("li"),n=C("i"),n.textContent=i,s=U(),ge(l.$$.fragment),this.h()},l(r){t=L(r,"LI",{class:!0});var c=T(t);n=L(c,"I",{class:!0,"data-svelte-h":!0}),Oe(n)!=="svelte-5qeiac"&&(n.textContent=i),s=G(c),me(l.$$.fragment,c),c.forEach(y),this.h()},h(){S(n,"class","svelte-1x90noz"),S(t,"class","exact svelte-1x90noz")},m(r,c){z(r,t,c),w(t,n),w(t,s),ke(l,t,null),o=!0},p(r,c){const f={};c[0]&8&&(f.id=r[3]),l.$set(f)},i(r){o||(F(l.$$.fragment,r),o=!0)},o(r){M(l.$$.fragment,r),o=!1},d(r){r&&y(t),ve(l)}}}function ut(e){let t;function n(l,o){return l[4]>=2**5&&l[4]<2**13?_n:pn}let i=n(e),s=i(e);return{c(){s.c(),t=fe()},l(l){s.l(l),t=fe()},m(l,o){s.m(l,o),z(l,t,o)},p(l,o){i===(i=n(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(t.parentNode,t)))},d(l){l&&y(t),s.d(l)}}}function pn(e){let t,n="Action code is out of range";return{c(){t=C("li"),t.textContent=n,this.h()},l(i){t=L(i,"LI",{class:!0,"data-svelte-h":!0}),Oe(t)!=="svelte-vlyulj"&&(t.textContent=n),this.h()},h(){S(t,"class","svelte-1x90noz")},m(i,s){z(i,t,s)},p:ce,d(i){i&&y(t)}}}function _n(e){let t,n,i="USE CODE",s,l;return{c(){t=C("li"),n=C("button"),n.textContent=i,this.h()},l(o){t=L(o,"LI",{class:!0});var r=T(t);n=L(r,"BUTTON",{"data-svelte-h":!0}),Oe(n)!=="svelte-1v2c76y"&&(n.textContent=i),r.forEach(y),this.h()},h(){S(t,"class","svelte-1x90noz")},m(o,r){z(o,t,r),w(t,n),s||(l=J(n,"click",e[21]),s=!0)},p:ce,d(o){o&&y(t),s=!1,l()}}}function at(e){let t=[],n=new Map,i,s,l=Ie(e[7]?e[28].filter(e[22]):e[28]);const o=r=>r[29];for(let r=0;r0)&&at(Pe(e));return ue=gt(e[18][0]),{c(){t=C("dialog"),n=C("div"),i=C("div"),s=C("input"),o=U(),r=C("button"),f=b(c),h=U(),a=C("button"),a.textContent=p,u=U(),d=C("fieldset"),v=C("label"),g=b(A),_=C("input"),R=U();for(let E=0;E{I=null}),oe()),E[3]!==void 0?q?(q.p(E,j),j[0]&8&&F(q,1)):(q=ht(E),q.c(),F(q,1),q.m($,ie)):q&&(re(),M(q,1,1,()=>{q=null}),oe()),!E[3]&&E[4]?H?H.p(E,j):(H=ut(E),H.c(),H.m($,se)):H&&(H.d(1),H=null),E[7]!==void 0||E[2].length>0?B?(B.p(Pe(E),j),j[0]&132&&F(B,1)):(B=at(Pe(E)),B.c(),F(B,1),B.m($,null)):B&&(re(),M(B,1,1,()=>{B=null}),oe())},i(E){Y||(F(I),F(q),F(B),Y=!0)},o(E){M(I),M(q),M(B),Y=!1},d(E){E&&y(t),e[13](null),Pt(m,E),I&&I.d(),q&&q.d(),H&&H.d(),B&&B.d(),e[24](null),ue.r(),ae=!1,qt(Ae)}}}function mn(e,t,n){let i;je(e,Me,m=>n(8,i=m));let{currentAction:s=void 0}=t,{nextAction:l=void 0}=t;Bt(()=>{d.focus()});const o=new on.Index({tokenize:"full"});r();async function r(){for(const[,m]of He)await o?.addAsync(m.code,`${m.title||""} ${m.variant||""} ${m.category} ${m.id||""} ${m.description||""}`)}async function c(){n(2,a=await o.searchAsync(d.value)),n(3,p=Ut.get(d.value)?.code),n(4,k=Number(d.value))}function f(m){m!==void 0&&u("select",m)}function h(m){if(m.shiftKey&&m.key==="Enter")u("select",p);else if(m.key==="ArrowDown"){const I=v.querySelector("li:focus-within")?.nextSibling??v.querySelector("li:not(.exact)");I instanceof HTMLLIElement&&I.querySelector("button")?.focus()}else if(m.key==="ArrowUp"){const I=v.querySelector("li:focus-within")?.previousSibling??v.querySelector("li:not(.exact)");I instanceof HTMLLIElement&&I.querySelector("button")?.focus()}else{d.focus();return}m.preventDefault()}let a=[],p,k=Number.NaN;const u=Ft();let d,v,A;const g=[[]];function _(m){Je[m?"unshift":"push"](()=>{d=m,n(5,d)})}const R=m=>{m.key==="Enter"&&f(p)},K=()=>f(0),V=()=>u("close");function $(){A=this.__value,n(7,A)}function ie(){A=this.__value,n(7,A)}const se=()=>f(p),Y=()=>f(k),ue=m=>A.has(m),ae=m=>f(m);function Ae(m){Je[m?"unshift":"push"](()=>{v=m,n(6,v)})}const Q=()=>u("close");return e.$$set=m=>{"currentAction"in m&&n(0,s=m.currentAction),"nextAction"in m&&n(1,l=m.nextAction)},[s,l,a,p,k,d,v,A,i,c,f,h,u,_,R,K,V,$,g,ie,se,Y,ue,ae,Ae,Q]}class Ln extends Ue{constructor(t){super(),Ge(this,t,mn,gn,Re,{currentAction:0,nextAction:1},null,[-1,-1])}}function kn(e){let t=e[0].share.URL_COPIED()+"",n;return{c(){n=b(t)},l(i){n=x(i,t)},m(i,s){z(i,n,s)},p(i,[s]){s&1&&t!==(t=i[0].share.URL_COPIED()+"")&&Z(n,t)},i:ce,o:ce,d(i){i&&y(n)}}}function vn(e,t,n){let i;return je(e,Me,s=>n(0,i=s)),[i]}class In extends Ue{constructor(t){super(),Ge(this,t,vn,kn,Re,{})}}export{Ln as A,on as F,In as S}; //# sourceMappingURL=SharePopup.DIKEC4Cs.js.map