/home/smartbloks/.trash/_astro/search-input.DORe3rJu.js
import{c as fe,g as me}from"./_commonjsHelpers.Cpj98o6Y.js";import{_ as ve}from"./_plugin-vue_export-helper.DlAUqK2U.js";import{d as he,a as ye,j as ge,o as we}from"./runtime-core.esm-bundler.CZdcCkn7.js";var ne={exports:{}};(function(Y,W){(function(C,N){Y.exports=N()})(typeof self<"u"?self:fe,()=>(()=>{var C={75:function(s){(function(){var c,d,_,h,w,g;typeof performance<"u"&&performance!==null&&performance.now?s.exports=function(){return performance.now()}:typeof process<"u"&&process!==null&&process.hrtime?(s.exports=function(){return(c()-w)/1e6},d=process.hrtime,h=(c=function(){var f;return 1e9*(f=d())[0]+f[1]})(),g=1e9*process.uptime(),w=h-g):Date.now?(s.exports=function(){return Date.now()-_},_=Date.now()):(s.exports=function(){return new Date().getTime()-_},_=new Date().getTime())}).call(this)},4087:(s,c,d)=>{for(var _=d(75),h=typeof window>"u"?d.g:window,w=["moz","webkit"],g="AnimationFrame",f=h["request"+g],O=h["cancel"+g]||h["cancelRequest"+g],x=0;!f&&x<w.length;x++)f=h[w[x]+"Request"+g],O=h[w[x]+"Cancel"+g]||h[w[x]+"CancelRequest"+g];if(!f||!O){var P=0,L=0,b=[];f=function(y){if(b.length===0){var T=_(),F=Math.max(0,16.666666666666668-(T-P));P=F+T,setTimeout(function(){var A=b.slice(0);b.length=0;for(var D=0;D<A.length;D++)if(!A[D].cancelled)try{A[D].callback(P)}catch(j){setTimeout(function(){throw j},0)}},Math.round(F))}return b.push({handle:++L,callback:y,cancelled:!1}),L},O=function(y){for(var T=0;T<b.length;T++)b[T].handle===y&&(b[T].cancelled=!0)}}s.exports=function(y){return f.call(h,y)},s.exports.cancel=function(){O.apply(h,arguments)},s.exports.polyfill=function(y){y||(y=h),y.requestAnimationFrame=f,y.cancelAnimationFrame=O}}},N={};function p(s){var c=N[s];if(c!==void 0)return c.exports;var d=N[s]={exports:{}};return C[s].call(d.exports,d,d.exports,p),d.exports}p.n=s=>{var c=s&&s.__esModule?()=>s.default:()=>s;return p.d(c,{a:c}),c},p.d=(s,c)=>{for(var d in c)p.o(c,d)&&!p.o(s,d)&&Object.defineProperty(s,d,{enumerable:!0,get:c[d]})},p.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),p.o=(s,c)=>Object.prototype.hasOwnProperty.call(s,c);var k={};return(()=>{p.d(k,{default:()=>oe});var s=p(4087),c=p.n(s);const d=function(o){return new RegExp(/<[a-z][\s\S]*>/i).test(o)},_=function(o,t){return Math.floor(Math.random()*(t-o+1))+o};var h="TYPE_CHARACTER",w="REMOVE_CHARACTER",g="REMOVE_ALL",f="REMOVE_LAST_VISIBLE_NODE",O="PAUSE_FOR",x="CALL_FUNCTION",P="ADD_HTML_TAG_ELEMENT",L="CHANGE_DELETE_SPEED",b="CHANGE_DELAY",y="CHANGE_CURSOR",T="PASTE_STRING",F="HTML_TAG";function A(o){return A=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},A(o)}function D(o,t){var a=Object.keys(o);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(o);t&&(r=r.filter(function(S){return Object.getOwnPropertyDescriptor(o,S).enumerable})),a.push.apply(a,r)}return a}function j(o){for(var t=1;t<arguments.length;t++){var a=arguments[t]!=null?arguments[t]:{};t%2?D(Object(a),!0).forEach(function(r){u(o,r,a[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(a)):D(Object(a)).forEach(function(r){Object.defineProperty(o,r,Object.getOwnPropertyDescriptor(a,r))})}return o}function M(o){return function(t){if(Array.isArray(t))return $(t)}(o)||function(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}(o)||function(t,a){if(t){if(typeof t=="string")return $(t,a);var r=Object.prototype.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?$(t,a):void 0}}(o)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function $(o,t){(t==null||t>o.length)&&(t=o.length);for(var a=0,r=new Array(t);a<t;a++)r[a]=o[a];return r}function re(o,t){for(var a=0;a<t.length;a++){var r=t[a];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(o,J(r.key),r)}}function u(o,t,a){return(t=J(t))in o?Object.defineProperty(o,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):o[t]=a,o}function J(o){var t=function(a,r){if(A(a)!=="object"||a===null)return a;var S=a[Symbol.toPrimitive];if(S!==void 0){var e=S.call(a,"string");if(A(e)!=="object")return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(a)}(o);return A(t)==="symbol"?t:String(t)}const oe=function(){function o(r,S){var e=this;if(function(n,i){if(!(n instanceof i))throw new TypeError("Cannot call a class as a function")}(this,o),u(this,"state",{cursorAnimation:null,lastFrameTime:null,pauseUntil:null,eventQueue:[],eventLoop:null,eventLoopPaused:!1,reverseCalledEvents:[],calledEvents:[],visibleNodes:[],initialOptions:null,elements:{container:null,wrapper:document.createElement("span"),cursor:document.createElement("span")}}),u(this,"options",{strings:null,cursor:"|",delay:"natural",pauseFor:1500,deleteSpeed:"natural",loop:!1,autoStart:!1,devMode:!1,skipAddStyles:!1,wrapperClassName:"Typewriter__wrapper",cursorClassName:"Typewriter__cursor",stringSplitter:null,onCreateTextNode:null,onRemoveNode:null}),u(this,"setupWrapperElement",function(){e.state.elements.container&&(e.state.elements.wrapper.className=e.options.wrapperClassName,e.state.elements.cursor.className=e.options.cursorClassName,e.state.elements.cursor.innerHTML=e.options.cursor,e.state.elements.container.innerHTML="",e.state.elements.container.appendChild(e.state.elements.wrapper),e.state.elements.container.appendChild(e.state.elements.cursor))}),u(this,"start",function(){return e.state.eventLoopPaused=!1,e.runEventLoop(),e}),u(this,"pause",function(){return e.state.eventLoopPaused=!0,e}),u(this,"stop",function(){return e.state.eventLoop&&((0,s.cancel)(e.state.eventLoop),e.state.eventLoop=null),e}),u(this,"pauseFor",function(n){return e.addEventToQueue(O,{ms:n}),e}),u(this,"typeOutAllStrings",function(){return typeof e.options.strings=="string"?(e.typeString(e.options.strings).pauseFor(e.options.pauseFor),e):(e.options.strings.forEach(function(n){e.typeString(n).pauseFor(e.options.pauseFor).deleteAll(e.options.deleteSpeed)}),e)}),u(this,"typeString",function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(d(n))return e.typeOutHTMLString(n,i);if(n){var m=(e.options||{}).stringSplitter,v=typeof m=="function"?m(n):n.split("");e.typeCharacters(v,i)}return e}),u(this,"pasteString",function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return d(n)?e.typeOutHTMLString(n,i,!0):(n&&e.addEventToQueue(T,{character:n,node:i}),e)}),u(this,"typeOutHTMLString",function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,m=arguments.length>2?arguments[2]:void 0,v=function(Q){var H=document.createElement("div");return H.innerHTML=Q,H.childNodes}(n);if(v.length>0)for(var l=0;l<v.length;l++){var E=v[l],R=E.innerHTML;E&&E.nodeType!==3?(E.innerHTML="",e.addEventToQueue(P,{node:E,parentNode:i}),m?e.pasteString(R,E):e.typeString(R,E)):E.textContent&&(m?e.pasteString(E.textContent,i):e.typeString(E.textContent,i))}return e}),u(this,"deleteAll",function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"natural";return e.addEventToQueue(g,{speed:n}),e}),u(this,"changeDeleteSpeed",function(n){if(!n)throw new Error("Must provide new delete speed");return e.addEventToQueue(L,{speed:n}),e}),u(this,"changeDelay",function(n){if(!n)throw new Error("Must provide new delay");return e.addEventToQueue(b,{delay:n}),e}),u(this,"changeCursor",function(n){if(!n)throw new Error("Must provide new cursor");return e.addEventToQueue(y,{cursor:n}),e}),u(this,"deleteChars",function(n){if(!n)throw new Error("Must provide amount of characters to delete");for(var i=0;i<n;i++)e.addEventToQueue(w);return e}),u(this,"callFunction",function(n,i){if(!n||typeof n!="function")throw new Error("Callback must be a function");return e.addEventToQueue(x,{cb:n,thisArg:i}),e}),u(this,"typeCharacters",function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!n||!Array.isArray(n))throw new Error("Characters must be an array");return n.forEach(function(m){e.addEventToQueue(h,{character:m,node:i})}),e}),u(this,"removeCharacters",function(n){if(!n||!Array.isArray(n))throw new Error("Characters must be an array");return n.forEach(function(){e.addEventToQueue(w)}),e}),u(this,"addEventToQueue",function(n,i){var m=arguments.length>2&&arguments[2]!==void 0&&arguments[2];return e.addEventToStateProperty(n,i,m,"eventQueue")}),u(this,"addReverseCalledEvent",function(n,i){var m=arguments.length>2&&arguments[2]!==void 0&&arguments[2];return e.options.loop?e.addEventToStateProperty(n,i,m,"reverseCalledEvents"):e}),u(this,"addEventToStateProperty",function(n,i){var m=arguments.length>2&&arguments[2]!==void 0&&arguments[2],v=arguments.length>3?arguments[3]:void 0,l={eventName:n,eventArgs:i||{}};return e.state[v]=m?[l].concat(M(e.state[v])):[].concat(M(e.state[v]),[l]),e}),u(this,"runEventLoop",function(){e.state.lastFrameTime||(e.state.lastFrameTime=Date.now());var n=Date.now(),i=n-e.state.lastFrameTime;if(!e.state.eventQueue.length){if(!e.options.loop)return;e.state.eventQueue=M(e.state.calledEvents),e.state.calledEvents=[],e.options=j({},e.state.initialOptions)}if(e.state.eventLoop=c()(e.runEventLoop),!e.state.eventLoopPaused){if(e.state.pauseUntil){if(n<e.state.pauseUntil)return;e.state.pauseUntil=null}var m,v=M(e.state.eventQueue),l=v.shift();if(!(i<=(m=l.eventName===f||l.eventName===w?e.options.deleteSpeed==="natural"?_(40,80):e.options.deleteSpeed:e.options.delay==="natural"?_(120,160):e.options.delay))){var E=l.eventName,R=l.eventArgs;switch(e.logInDevMode({currentEvent:l,state:e.state,delay:m}),E){case T:case h:var Q=R.character,H=R.node,K=document.createTextNode(Q),I=K;e.options.onCreateTextNode&&typeof e.options.onCreateTextNode=="function"&&(I=e.options.onCreateTextNode(Q,K)),I&&(H?H.appendChild(I):e.state.elements.wrapper.appendChild(I)),e.state.visibleNodes=[].concat(M(e.state.visibleNodes),[{type:"TEXT_NODE",character:Q,node:I}]);break;case w:v.unshift({eventName:f,eventArgs:{removingCharacterNode:!0}});break;case O:var ae=l.eventArgs.ms;e.state.pauseUntil=Date.now()+parseInt(ae);break;case x:var Z=l.eventArgs,se=Z.cb,ie=Z.thisArg;se.call(ie,{elements:e.state.elements});break;case P:var ee=l.eventArgs,B=ee.node,G=ee.parentNode;G?G.appendChild(B):e.state.elements.wrapper.appendChild(B),e.state.visibleNodes=[].concat(M(e.state.visibleNodes),[{type:F,node:B,parentNode:G||e.state.elements.wrapper}]);break;case g:var ue=e.state.visibleNodes,V=R.speed,U=[];V&&U.push({eventName:L,eventArgs:{speed:V,temp:!0}});for(var te=0,le=ue.length;te<le;te++)U.push({eventName:f,eventArgs:{removingCharacterNode:!1}});V&&U.push({eventName:L,eventArgs:{speed:e.options.deleteSpeed,temp:!0}}),v.unshift.apply(v,U);break;case f:var pe=l.eventArgs.removingCharacterNode;if(e.state.visibleNodes.length){var z=e.state.visibleNodes.pop(),ce=z.type,q=z.node,de=z.character;e.options.onRemoveNode&&typeof e.options.onRemoveNode=="function"&&e.options.onRemoveNode({node:q,character:de}),q&&q.parentNode.removeChild(q),ce===F&&pe&&v.unshift({eventName:f,eventArgs:{}})}break;case L:e.options.deleteSpeed=l.eventArgs.speed;break;case b:e.options.delay=l.eventArgs.delay;break;case y:e.options.cursor=l.eventArgs.cursor,e.state.elements.cursor.innerHTML=l.eventArgs.cursor}e.options.loop&&(l.eventName===f||l.eventArgs&&l.eventArgs.temp||(e.state.calledEvents=[].concat(M(e.state.calledEvents),[l]))),e.state.eventQueue=v,e.state.lastFrameTime=n}}}),r)if(typeof r=="string"){var X=document.querySelector(r);if(!X)throw new Error("Could not find container element");this.state.elements.container=X}else this.state.elements.container=r;S&&(this.options=j(j({},this.options),S)),this.state.initialOptions=j({},this.options),this.init()}var t,a;return t=o,(a=[{key:"init",value:function(){var r,S;this.setupWrapperElement(),this.addEventToQueue(y,{cursor:this.options.cursor},!0),this.addEventToQueue(g,null,!0),!window||window.___TYPEWRITER_JS_STYLES_ADDED___||this.options.skipAddStyles||(r=".Typewriter__cursor{-webkit-animation:Typewriter-cursor 1s infinite;animation:Typewriter-cursor 1s infinite;margin-left:1px}@-webkit-keyframes Typewriter-cursor{0%{opacity:0}50%{opacity:1}100%{opacity:0}}@keyframes Typewriter-cursor{0%{opacity:0}50%{opacity:1}100%{opacity:0}}",(S=document.createElement("style")).appendChild(document.createTextNode(r)),document.head.appendChild(S),window.___TYPEWRITER_JS_STYLES_ADDED___=!0),this.options.autoStart===!0&&this.options.strings&&this.typeOutAllStrings().start()}},{key:"logInDevMode",value:function(r){this.options.devMode&&console.log(r)}}])&&re(t.prototype,a),Object.defineProperty(t,"prototype",{writable:!1}),o}()})(),k.default})())})(ne);var Ee=ne.exports;const be=me(Ee),Te=he({__name:"search-input",setup(Y,{expose:W}){W();let C;we(()=>{var p=document.getElementById("input"),k=function(s){return p.placeholder=p.placeholder+s,null};C=new be(p,{delay:40,deleteSpeed:4,onCreateTextNode:k}),C.typeString("What type of website do you want to create?").pauseFor(1e3).start()});const N={get typewriter(){return C},set typewriter(p){C=p}};return Object.defineProperty(N,"__isScriptSetup",{enumerable:!1,value:!0}),N}}),Se={class:"px-6 lg:px-10 w-full lg:max-w-[44rem] h-[65px] lg:h-[4.6rem] outline-none appearance-none placeholder:text-[1.1rem] placeholder:font-light",type:"text",id:"input",placeholder:""};function _e(Y,W,C,N,p,k){return ye(),ge("input",Se)}const Oe=ve(Te,[["render",_e]]);export{Oe as default};